Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Applaying Framework7 with Remix.js

未关闭
#4,297 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
react, typescript

调研方向

从 app/root.tsx 开始,重点查看 Framework7 App/View 配置和 Remix Outlet,然后比较 app/routes/_index.tsx 与 app/routes/about.tsx 中的导航。复现链接导航,并验证浏览器 URL 会更新,同时预期页面会通过 Remix 和 Framework7 路由器进行渲染。

由索引模型根据 Issue 内容生成。

描述

Overview

Hello Folks,
I'm trying to apply Framework7 latest version [v8.3.4] to my Remix.js app, i do all nesessry things from boath side (remix and framework7) and it's working with remix router issue

Explain the project Remix.js file
  • app/root.tsx
  • app/routers/_index.tsx
  • app/routers/about.tsx

let's take a look how this file look like with the code:

  • for full code overview take a look to this code repo: []
1- root.tsx:
import {
	Links,
	Meta,
	Scripts,
	Outlet,
	ScrollRestoration,
} from "@remix-run/react";
import type { LinksFunction } from "@remix-run/node";

// Import F7 Bundle and React Plugin
import Framework7 from 'framework7/lite-bundle';
import Framework7React, { App, View } from 'framework7-react';


import AboutPage from './routes/about';
import HomePage from './routes/_index';


// Initialize Framework7 with the React plugin globally
Framework7.use(Framework7React);

// Framework7 module styles
import '../node_modules/framework7/framework7-bundle.css'

export const links: LinksFunction = () => [
	{ rel: "preconnect", href: "https://fonts.googleapis.com" },
	{
		rel: "preconnect",
		href: "https://fonts.gstatic.com",
		crossOrigin: "anonymous",
	},
	{
		rel: "stylesheet",
		href: "https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",
	},
];

export function Layout({ children }: { children: React.ReactNode }) {
	return (
		<html lang="en">
			<head>
				<meta charSet="utf-8" />
				<meta name="viewport" content="width=device-width, initial-scale=1" />
				<Meta />
				<Links />
			</head>
			<body>
				{children}
				<ScrollRestoration />
				<Scripts />
			</body>
		</html>
	);
}

const f7params = {
	name: 'My App',
	// routes
	routes: [
		{
			path: '/',
			component: HomePage,
		},
		{
			path: '/about/',
			component: AboutPage,
		},
	],
	// ... other params
}

export default function MyApp() {
	return (
		<App theme="auto" {...f7params}>
			{/* Main View component with "main" prop */}
			<View main url="/ss">
				{/* This renders nested routes via Outlet */}
				<Outlet />
			</View>
		</App>
	);
}
2- _index.tsx: (as home page with route '/')
import type { MetaFunction } from "@remix-run/node";
import { Link } from "@remix-run/react";
import { Navbar, Page } from 'framework7-react';

export const meta: MetaFunction = () => {
	return [
		{ title: "New Remix App" },
		{ name: "description", content: "Welcome to Remix!" },
	];
};

export default function Index() {
	return (
		// Main Framework7 App component where we pass Framework7 params
		<Page>
			<Navbar title="Home" />
			<p>Welcome to the Home Page</p>
			<Link to="/about/">About Page</Link>
		</Page>
	);
}
3- about.tsx: (as home page with route '/about')
import type { MetaFunction } from "@remix-run/node";
import { Link } from "@remix-run/react";
import { Page, Navbar } from 'framework7-react';

export const meta: MetaFunction = () => {
	return [
		{ title: "Remix App - About" },
		{ name: "description", content: "Welcome to About Page!" },
	];
};

const about = () => {
  return (
	<Page>
		{/* Top Navbar */}
		<Navbar title="About"></Navbar>
		{/* Page Content */}
		<p>Page About</p>
		<Link to="/">Home</Link>
	</Page>
  )
}

export default about

I was wondering how to make router in Framework7 compatible with Remix
this is working but url not updated on my browser

主要语言
JavaScript
星标
18.8k
派生
3.2k
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

framework7io/framework7 的其他 Issue

查看 framework7io/framework7 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。