weex导入css文件和ElementUI


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

2.foo.vue中

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;

相关