【发布时间】:2019-04-11 13:47:29
【问题描述】:
我有一个项目: https://github.com/merrymaker14/vuegl
我决定上传到 GitHub Pages: https://merrymaker14.github.io/vuegl
但他并没有正常浏览这些页面,尽管他似乎已经设置了所有内容。为什么? 我都是按照官方文档做的。
nuxt.config.js:
/* nuxt.config.js */
// only add `router.base = '/<repository-name>/'` if `DEPLOY_ENV` is `GH_PAGES`
const routerBase = process.env.DEPLOY_ENV === 'GH_PAGES' ? {
router: {
base: '/vuegl/'
}
} : {}
export default {
mode: 'universal',
/*
** Headers of the page
*/
head: {
title: pkg.name,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
...routerBase,
router: {
middleware: 'pages',
//base: '/examples/vuegl/'
},
/*
** Global CSS
*/
css: [
],
/*
** Plugins to load before mounting the App
*/
plugins: [
],
/*
** Nuxt.js modules
*/
modules: [
],
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {
}
}
}```
【问题讨论】:
-
您的路由器底座似乎没有设置好。你是在构建时设置的吗?
-
没有。顺便说一句,动画组件(有 Three.js)也不行。
-
i.stack.imgur.com/FX9Lw.png - 这很奇怪。
标签: nuxt.js