weex导入css文件和ElementUI

weex导入css文件:
1.webpack.config.js中
loaders:[
...
,  {
    test: /\.css$/,
    loader: 'babel',
    exclude: /node_modules/
  }
]

2.foo.vue中
<button class='test' style='font-size:6em'>aaaaaaaaaaa</button>

<style>
  @import "../assets/css1.css";
</style>

http://www.jianshu.com/p/5ba253651c3b
npm install style-loader --save-dev
npm install css-loader --save-dev
npm install file-loader --save-dev
在 webpack.config.js 中的 loaders 数组加入以下配置
,
{
  test: /\.css$/,
  loader: "style!css"
},
{
  test: /\.(eot|woff|woff2|ttf)([\?]?.*)$/,
  loader: "file"
}

app.js中

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-default/index.css'

import foo from './src/foo.vue'
foo.el = '#root'
let vue = new Vue(foo);
vue.use(ElementUI)
//export default new Vue(foo);
export default vue;

 

posted on 2019-10-11 10:35  _xinT  阅读(1018)  评论(3编辑  收藏  举报