Giter Site home page Giter Site logo

ticken-tob-app's Introduction

Getting Started

First, run the development server:

npm run dev

如何切换路由

除了 Root 和 App 组件,其他组件均使用 next router

import Link from 'next/link';
import { useRouter } from 'next/router';

export default function Events() {
  return <Link href='/#/orders'>Orders</Link>;
}

如何识别多语言?

项目使用的是 next-i18next,不同语言的场景体现在 pathname 的变化上,由于全局使用 hash 路由,所以不需要在意 path 的变化

如何修改语言包?

在 public 目录的 locales 下是不同语言包的 json

理论上我们同语言的所有词条都写在 common.json 里,因为我们只有一个单页,切换菜单路由仅仅是切换客户端组件修改 hash

在 react 组件中如何使用?

useTranslation 的依赖由 react-i18next 改成 next-i18next 即可

import { useTranslation } from 'next-i18next';
export default function Header() {
  const { t } = useTranslation();

  return (
    <div>
      <ConnectButton />
    </div>
  );
}

ticken-tob-app's People

Contributors

qinluhe avatar dxiaoqi avatar

Stargazers

Vishal Patil avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.