This extension adds Vue Property Decorator Code snippets into Visual Studio Code.
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) {...} |
- Vue Property Decorator : to use all
vuedec-
snippets - Vuex Module Decorators : to use all
vuexdec-
snippets
vue
(.vue)typescript
(.ts)
Not yet.
Check CHANGELOG.md