生活随笔
收集整理的這篇文章主要介紹了
脚手架 插件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、定義插件
plugin.js --> export default{} --> install() -->
Vue
.filter('myFilter', function (value) {return value
.slice(0, 4);
});
Vue
.directive("fbind", {bind(element, binding) {element
.value
= binding
.value
;},inserted(element, binding) {element
.style
.backgroundColor
= 'green';element
.focus();},update(element, binding) {element
.value
= binding
.value
;}
});
Vue
.mixin({data() {return {x
: 100,y
: 200}},
});
Vue.prototype
.hello = () => console
.log('hello');
二、使用插件
Vue
.use(插件名
);
Vue
.use(plugins
, 1, 2, 3);
install(Vue, a, b, c) {}
總結
以上是生活随笔為你收集整理的脚手架 插件的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。