import Mint from 'mint-ui';
import 'mint-ui/lib/style.css';
Vue.use(Mint);
this.$toast({
message: '提示语句',
position: 'middle',
duration: 5000
})
this.$messagebox.confirm('确定吗提交吗','提示')
import { Toast,MessageBox,Indicator,Loadmore } from 'mint-ui';
Vue.prototype.$MessageBox = MessageBox;
Vue.prototype.$toast = Toast;
Vue.prototype.$indicator = Indicator;
Vue.component(Loadmore.name, Loadmore);
this.$MessageBox.alert('修改成功')
this.$toast({
message: '请选择出生日期',
position: 'middle',
duration: 3000
});
全局引入css缺少loader,安装:
npm install css-loader style-loader --save-dev
然后在build的config中配置css loader,module.rules下面添加一项
{
test: /\.css$/,
loader:"style-loader!css-loader"
}
引入css报错原因:
npm install babel-plugin-component --save
npm install babel-preset-es2015
在.babelrc 里面添加代码
"plugins": [
"transform-vue-jsx",
"transform-runtime",
[
"component",
[
{
"libraryName": "mint-ui",
"style": true
}
]
]
]