本身从一个月以前正式的接触vue.js这个框架,而后就疯狂的迷恋上他,易上手我以为是他最大的优点,以前我一直是使用Jquery的,大量的dom操做让我有点力不从心,以前的我安于现状不想去探索新的知识,直到我直到vue而且使用上他以后,本身的生产力仿佛获得了质的飞跃,闲话少叙,进入今天的主题Mint-ui连接描述。css
第一步vue
安装mint-ui npm install mint-ui --save
第二步webpack
在main.js里面引入mint-ui import MintUI from 'mint-ui' import 'mint-ui/lib/style.css'//最嗨的是他这个直接引入的是一个css文件 Vue.use(MintUI);
第三步git
由于webpack把须要的依赖都下载好了我只须要安装下面的依赖就好啦 install babel-preset-es2015 --save-dev
第四步github
配置你的babelrc文件
{ "presets": ["es2015", "stage-2"], "plugins": ["transform-runtime"], "comments": false }
第五步
下面重启一下就能够直接在组件使用啦
须要注意的是,虽然是全局使用,可是在使用的过程当中仍是要在组件内引用一下你须要使用的组件web
<template> <div class="header"> <div @click='test'>{{headerProps.title}}</div> </div> </template> <script type="text/ecmascript-6"> import {DatetimePicker, Button, Toast} from 'mint-ui'; export default { props: { headerProps: Object }, data(){ return {} }, methods:{ test(){ Toast('我是Tip'); } } } </script> <style lang="scss"> .header { /*position: fixed;*/ z-index: 99; width: 100%; background: #f55947; height: 3rem; font: { size: 1.2rem; weight: 100; } ; div { text-align: center; line-height: 3rem; color: #fff; font: { weight: 300; } ; } } </style>
从安装到使用的过程就是这样啦,我也是刚接触vue这个框架,有问题的地方请大神指出呀,也但愿能和你们一块儿学习进步~~~~npm