Browse Source

修改样式引入方式

yingp 8 years ago
parent
commit
fed257e254
2 changed files with 11 additions and 16 deletions
  1. 4 0
      app.html
  2. 7 16
      nuxt.config.js

+ 4 - 0
app.html

@@ -1,6 +1,10 @@
 <!DOCTYPE html>
 <html {{ HTML_ATTRS }}>
 <head>
+  <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
+  <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
+  <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/element-ui/1.3.7/theme-default/index.css"/>
+  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_0d1jjt5tukcblnmi.css"/>
   {{ HEAD }}
   <script>
     (function (w, d) {

+ 7 - 16
nuxt.config.js

@@ -1,7 +1,6 @@
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
 const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://www.usoftmall.com/' : 'http://192.168.253.60:9090/platform-b2c/')
-const webpack = require('webpack')
 
 module.exports = {
   router: {
@@ -20,11 +19,7 @@ module.exports = {
       { hid: 'description', name: 'description', content: '优软商城(usoftmall.com)是中国领先的IC电子元器件现货采购交易网上商城,提供上千万种电子元器件现货采购交易,采购电子元器件就上优软商城!' }
     ],
     link: [
-      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
-      { rel: 'stylesheet', type: 'text/css', href: 'https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css' },
-      { rel: 'stylesheet', type: 'text/css', href: 'https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css' },
-      { rel: 'stylesheet', type: 'text/css', href: 'https://cdn.bootcss.com/element-ui/1.3.7/theme-default/index.css' },
-      { rel: 'stylesheet', type: 'text/css', href: 'https://at.alicdn.com/t/font_0d1jjt5tukcblnmi.css' }
+      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
     ]
   },
   /*
@@ -76,16 +71,12 @@ module.exports = {
       })
     ]
   },
-  css: [
-    /* {
-    src: 'font-awesome/css/font-awesome.css'
-  }, */{src: '~assets/scss/app.scss', lang: 'scss'},
-    {
-      src: 'swiper/dist/css/swiper.css'
-    } /* , {
-      src: 'element-ui/lib/theme-default/index.css'
-    } */
-  ],
+  css: [ {
+    src: '~assets/scss/app.scss',
+    lang: 'scss'
+  }, {
+    src: 'swiper/dist/css/swiper.css'
+  }],
   dev: !isProdMode,
   env: {
     baseUrl