zoukankan      html  css  js  c++  java
  • next-定义路由

    在next.config.js里写

    const withCss = require('@zeit/next-css')
    
    if(typeof require !== 'undefined'){
        require.extensions['.css']=file=>{}
    }
    
    module.exports = withCss({
      exportPathMap: async function (defaultPathMap) {
        return {
          '/login': { page: '/login/user' },
        }
      }
    })

    没有css的时候

    // next.config.js
    module.exports = {
      exportPathMap: async function (defaultPathMap) {
        return {
          '/': { page: '/' },
          '/about': { page: '/about' },
          '/readme.md': { page: '/readme' },
          '/p/hello-nextjs': { page: '/post', query: { title: 'hello-nextjs' } },
          '/p/learn-nextjs': { page: '/post', query: { title: 'learn-nextjs' } },
          '/p/deploy-nextjs': { page: '/post', query: { title: 'deploy-nextjs' } }
        }
      }
    }
  • 相关阅读:
    ZOJ 1450
    HDU 3932
    POJ 3348
    POJ 1873
    POJ 1228
    POJ 2007
    POJ 1113
    POJ 1696
    POJ 1329
    HDU 3432
  • 原文地址:https://www.cnblogs.com/lxz-blogs/p/13602754.html
Copyright © 2011-2022 走看看