use*_*410 4 vue.js vuejs2 nuxt.js
我\xe2\x80\x99m 尝试使用 npm rungenerate\non 终端生成我的应用程序。I\xe2\x80\x99m 没有收到一些错误,一切都生成良好。在我的开发服务器中,路由组件等一切都运行良好,但是在生成后,当我打开 dist 文件夹中的 index.html 时,我可以 \xe2\x80\x99t 访问其他页面,在 chrome 控制台上出现类似错误。
\n\nFailed to load resource: net::ERR_FILE_NOT_FOUND\nf8ff67c7350097487a5e.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND\ne63cddd635f290d15a6f.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND\n9a1a3c7742fdcce5403a.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND\n1e056384fb18617ca6a5.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND\nbde8656.png:1 Failed to load resource: net::ERR_FILE_NOT_FOUND\n/favicon.ico:1 Failed to load resource: net::ERR_FILE_NOT_FOUND\nRun Code Online (Sandbox Code Playgroud)\n\n我尝试将 dist 文件夹上传到我的 ftp,但有太多相同\xe2\x80\xa6
\n\n这是我的 nuxt.config 文件
\n\nconst pkg = require('./package')\n\nmodule.exports = {\n mode: 'universal',\n\n /*\n ** Headers of the page\n */\n head: {\n title: pkg.name,\n meta: [\n { charset: 'utf-8' },\n { name: 'viewport', content: 'width=device-width, initial-scale=1' },\n { hid: 'description', name: 'description', content: pkg.description }\n ],\n link: [\n { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }\n ]\n },\n\n /*\n ** Customize the progress-bar color\n */\n loading: { color: '#fff' },\n\n /*\n ** Global CSS\n */\n css: [\n ],\n\n /*\n ** Plugins to load before mounting the App\n */\n plugins: [\n ],\n\n /*\n ** Nuxt.js modules\n */\n modules: [\n // Doc: https://github.com/nuxt-community/axios-module#usage\n '@nuxtjs/axios',\n // Doc:https://github.com/nuxt-community/modules/tree/master/packages/bulma\n '@nuxtjs/bulma',\n // ['nuxt-validate', {\n // lang: 'tr',\n // // regular vee-validate options \n // }]\n ],\n /*\n ** Axios module configuration\n */\n axios: {\n // See https://github.com/nuxt-community/axios-module#options\n },\n\n /*\n ** Build configuration\n */\n build: {\n postcss: {\n preset: {\n features: {\n customProperties: false\n }\n }\n },\n /*\n ** You can extend webpack config here\n */\n extend(config, ctx) {\n\n }\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n
如果您不是通过域根访问它,则需要在 nuxt 配置中设置它 https://nuxtjs.org/api/configuration-router/#base
export default {
router: {
base: '/app/'
}
}
Run Code Online (Sandbox Code Playgroud)