代码拉取完成,页面将自动刷新
import path from 'node:path'
export default {
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'nuxt2',
htmlAttrs: {
lang: 'en',
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' },
{ name: 'description', content: '这是一个自己搭建的SSR框架' },
{ name: 'keywords', contetn: 'Nuxt' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: ['element-ui/lib/theme-chalk/index.css', '~/static/style/base.less'],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: ['@/plugins/element-ui', { src: '@/plugins/icons', ssr: true }],
// 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',
],
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
baseURL: '/',
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
transpile: [/^element-ui/],
extend(config, ctx) {
const svgRule = config.module.rules.find((rule) => rule.test.test('.svg'))
svgRule.exclude = [path.resolve(__dirname, 'static/image/svgIcon')]
config.module.rules.push({
test: /\.svg$/,
include: [path.resolve(__dirname, 'static/image/svgIcon')],
loader: 'svg-sprite-loader',
options: {
symbolId: 'icon-[name]',
},
})
},
},
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。