代码拉取完成,页面将自动刷新
export default {
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
title: process.env.npm_package_name || '统一标题',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: process.env.npm_package_description || '自定义的描述信息' }
],
/* script: [
{src: 'http://code.jquery.com/jquery-2.1.1.min.js'}
], */
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
/* { rel: 'stylesheet', href: 'https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/1.4.0/css/bootstrap.min.css' } */
]
},
router: {
middleware: 'auth',
// 扩展路由
extendRoutes(routes, resolve) {
console.log(routes)
routes.push({
name: 'home',
path: '/index',
component: resolve(__dirname, 'pages/index.vue')
})
}
},
/**
* 定义系统默认loading效果, 或者指定一loading组件
*/
/* loading: {
color: '#399', height: '3px'
}, */
loading: '~/components/loading.vue',
// Global CSS (https://go.nuxtjs.dev/config-css)
css: [
'assets/css/transition.css',
'element-ui/lib/theme-chalk/index.css',
'assets/css/base.css'
],
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
plugins: [
'~/plugins/router',
{
src: '~/plugins/axios',
ssr: true, // 服务端渲染
},
{
src: '~/plugins/element-ui',
ssr: true
},
'~/plugins/mixins'
],
// Auto import components (https://go.nuxtjs.dev/config-components)
components: true,
// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
buildModules: [
],
// Modules (https://go.nuxtjs.dev/config-modules)
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
'cookie-universal-nuxt',
'@nuxtjs/style-resources'
],
styleResources: {
scss: [
'./assets/scss/global.scss'
]
},
// Axios module configuration (https://go.nuxtjs.dev/config-axios)
axios: {
proxy: true, // 开启axios跨域
// profix: '/api', // baseUrl
},
proxy: {
'/api': {
target: 'http:///localhost:3001', // 代理转发的地址
changeOrigin: true,
pathRewrite: {
// '^/api': ''
}
}
},
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
transpile: [/^element-ui/],
/**
* You can extend webpack config here
*/
extend (config, ctx) {
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。