Skip to content

Vue and Vuex Property Decorator Snippets for Visual Studio Code

Notifications You must be signed in to change notification settings

antsteyer/vscode-vue-decorator-snippets

Repository files navigation

vue-property-decorator-snippets README

This extension adds Vue Property Decorator Code snippets into Visual Studio Code.

Features

Prefix Vue Property Decorator Snippet Content Doc
vuedec-import import { Vue, Component, Prop, Watch, Emit, Ref } from "vue-property-decorator";
vuedec-comp @Component export default class Compenent extends Vue {...}
vuedec-newComp Equivalent to vuedec-import and vuedec-comp
vuedec-prop @Prop() readonly variable!: type;
vuedec-propsync @PropSync('name', { type: type }) variable!: type;
vuedec-data variable: type = defaultValue;
vuedec-watch @Watch(variableToWatch) onVariableChanged(val: type, oldVal; type) {...}
vuedec-model @Model() readonly variable!: type;
vuedec-prov @Provide() variable = value;
vuedec-provreact @ProvideReactive() variable = value;
vuedec-inject @Inject() readonly variable!: type;
vuedec-injectreact @InjectReactive() variable!: type;
vuedec-emit @Emit(event) myMethod() { ... }
vuedec-ref @Ref() readonly aComponent!: AComponent

Prefix Vuex Module Decorator Snippet Content
vuexdec-module import {... } from "vuex-module-decorators"; @Module export default class MyModule extends VuexModule {...}
vuexdec-dynamicModule import {... } from "vuex-module-decorators"; @Module({ dynamic: true, store, name: "myModule"}) export default class MyModule extends VuexModule {...}
vuexdec-mutation @Mutation myMutation(payload: type) {...}

Requirements

Supported Languages

  • vue (.vue)
  • typescript (.ts)

Known Issues

Not yet.

Release Notes

Check CHANGELOG.md

About

Vue and Vuex Property Decorator Snippets for Visual Studio Code

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published