Skip to content

vue扩展

对vue本身的提效目前是提供一些便捷的缩写,主要是争对选项式进行的优化。

1、提效之HTML缩写

缩写vue html 代码块
vcomponent<component :is="componentId"></component>
vka<keep-alive></keep-alive>
vtransition<transition></transition>
vtg<transition-group></transition-group>
vrl<router-link></router-link>
vrlt<router-link to=''></router-link>
vrv<router-view></router-view>

2、提效之JS缩写

缩写vue javascript 代码块
vgsilentVue.config.silent = true
vgehVue.config.errorHandler = function (err, vm, info) {}
vgwhVue.config.warnHandler = function (msg, vm, trace) {}
vgextendVue.extend({template: template})
vgsetVue.set(target, key, value)
vgdeleteVue.delete(target, key)
vdirectiveVue.directive({id, [definition]})
vgfilterVue.filter({id, [definition]})
vgcomponentVue.component({id, [definition]})
vgntVue.nextTick({})
vguseVue.use(plugin)
vgmixinVue.mixin({mixin})
vgcompileVue.compile(template)
vdatadata() { return
vmountedmounted () {}
vbmbeforeMount () {}
vcreatedcreated () {}
vbcbeforeCreate () {}
vupdatedupdated () {}
vbubeforeUpdate () {}
vactivatedactivated () {}
vdeactivateddeactivated () {}
vbdbeforeDestroy () {}
vdestroyeddestroyed () {}
vpropsprops: {}
vpdpropsData: {}
vcomputedcomputed: {}
vmethodsmethods: {}
vwatchwatch: {}
vwokey: { deep: true, immediate: true, handler: function (val, oldVal}) { } }
vdirectivesdirectives: {}
vfiltersfilters: {}
vcomponentscomponents: {}
vmixinsmixins:[]
vprovideprovide: {}
vinjectinject: []
vmodelmodel: {prop: '', event: ''}
vrenderrender(h) {}
vnewnew Vue({})
vntthis.$nextTick(() => {})
vdatathis.$data
vpropsthis.$props
velthis.$el
voptionsthis.$options
vparentthis.$parent
vrootthis.$root
vchildrenthis.$children
vslotsthis.$slots
vssthis.$scopedSlots.default({})
vrefsthis.$refs
visthis.$isServer
vattrsthis.$attrs
vlistenersthis.$listeners
vwatchthis.$watch(expOrFn, callback, [opitons])
vsetthis.$set(target, key, value)
vdeletethis.$delete
vonthis.$on(event, callback)
voncethis.$once(event, callback)
voffthis.$off(event, callback)
vemitthis.$emit(event, args)
vmountthis.$mount()
vfuthis.$forceUpdate()
vdestroythis.$destroy()

3、关闭提示

本部分主要针对选项式编程进行提效,如果采用组合式不需要本部分,可通过去掉勾选 use-vue-snippets禁用该部分功能。