nuxt.config.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. export default {
  2. // Global page headers: https://go.nuxtjs.dev/config-head
  3. head: {
  4. title: '',
  5. htmlAttrs: {
  6. lang: 'zh'
  7. },
  8. meta: [{
  9. charset: 'utf-8'
  10. },
  11. {
  12. name: 'viewport',
  13. content: 'width=device-width, initial-scale=1'
  14. },
  15. {
  16. hid: 'description',
  17. name: 'description',
  18. content: ''
  19. },
  20. {
  21. name: 'format-detection',
  22. content: 'telephone=no'
  23. }
  24. ],
  25. link: [{
  26. rel: 'icon',
  27. type: 'image/x-icon',
  28. href: '/favicon.ico'
  29. }]
  30. },
  31. ssr: false,
  32. // Global CSS: https://go.nuxtjs.dev/config-css
  33. css: [
  34. '@/assets/css/element-variables.scss',
  35. '@/assets/css/common.scss',
  36. '@/assets/css/reset.scss',
  37. 'swiper/css/swiper.css',
  38. '@/assets/css/element.scss',
  39. '@/assets/fonts/iconfont.css'
  40. ],
  41. // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  42. plugins: [
  43. '@/plugins/element-ui',
  44. {
  45. src: '@/plugins/vue-awesome-swiper',
  46. mode: 'client'
  47. },
  48. '@/plugins/axios',
  49. '@/plugins/init',
  50. ],
  51. // Auto import components: https://go.nuxtjs.dev/config-components
  52. components: true,
  53. // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  54. buildModules: [],
  55. // Modules: https://go.nuxtjs.dev/config-modules
  56. modules: [
  57. // https://go.nuxtjs.dev/axios
  58. '@nuxtjs/axios',
  59. '@nuxtjs/style-resources',
  60. ['cookie-universal-nuxt', {
  61. parseJSON: true
  62. }]
  63. ],
  64. // Axios module configuration: https://go.nuxtjs.dev/config-axios
  65. axios: {},
  66. // Build Configuration: https://go.nuxtjs.dev/config-build
  67. build: {
  68. transpile: [/^element-ui/],
  69. },
  70. router: {
  71. middleware: 'route', // 即每次路由跳转会调用该中间件
  72. base: '/pc/'
  73. //多个中间件写法
  74. // middleware: ['route']
  75. },
  76. styleResources: {
  77. scss: "./assets/css/variables.scss"
  78. },
  79. loading: {
  80. color: '#dd4250'
  81. }
  82. }