vue项目常用的插件安装命令
1.安装axiosnpm install --save axios2.安装饿了么uinpm i element-ui -s3.安装图片懒加载npm install vue-lazyload --save-dev main.js引入插件import VueLazyLoad from 'vue-lazyload'Vue.use(VueLazyLoad,{...
·
1.安装axios
npm install --save axios
2.安装饿了么ui
npm i element-ui -s
3.安装图片懒加载
npm install vue-lazyload --save-dev
main.js引入插件
import VueLazyLoad from 'vue-lazyload'
Vue.use(VueLazyLoad,{
error:'./static/error.png',
loading:'./static/loading.png'
})
使用
<img class="item-pic" v-lazy="newItem.picUrl"/>
4.安装vue-clipboard2插件
npm install --save vue-clipboard2
引入
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)
5.安装better-scroll
npm install better-scroll --save
饿了么ui按需加载
1.先安装babel-plugin-component插件
npm install babel-plugin-component -D
2..babelrc配置
{
"presets": [["es2015", { "modules": false }]],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
}
3.main.js的配置
import { Message, Carousel } from 'element-ui';
import App from './App.vue';
Vue.use(Message)
Vue.use(Carousel)
cdn资源链接
//vue.js
<script src="https://cdn.bootcss.com/vue/2.3.3/vue.min.js"></script>
//axios.js
<script src="https://cdn.bootcss.com/axios/0.16.2/axios.min.js"></script>
//vuex.js
<script src="https://cdn.bootcss.com/vuex/3.0.1/vuex.min.js"></script>
//element-ui.css
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
//element-ui.js
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
更多推荐
已为社区贡献13条内容
所有评论(0)