|
| 1 | +".text.html.vue": |
| 2 | + "Component include": |
| 3 | + "prefix": "component" |
| 4 | + "body": "<${1:componentName}></${1:componentName}>" |
| 5 | + "description": "Use a component in a template file" |
| 6 | + "descriptionMoreURL": "https://vuejs.org/v2/guide/components.html" |
| 7 | + "Router View": |
| 8 | + "prefix": "router-view" |
| 9 | + "body": "<router-view name=\"${1:routeName}\"></router-view>" |
| 10 | + "description": "Vuejs router-view component" |
| 11 | + "descriptionMoreURL": "https://router.vuejs.org/en/api/router-view.html" |
| 12 | + 'Router Link': |
| 13 | + 'prefix': 'router-link' |
| 14 | + 'body': '<router-link :to=\"{ name: \'${1:routeName}\', params: { ${2:property}: ${3:value}}}\"></router-link>' |
| 15 | + 'description': 'Vuejs router-link component with named route' |
| 16 | + 'descriptionMoreURL': 'https://router.vuejs.org/en/api/router-link.html' |
| 17 | + "Vue Component template": |
| 18 | + "prefix": "template" |
| 19 | + "body": """ |
| 20 | + <template> |
| 21 | + <div id="$1"> |
| 22 | +
|
| 23 | + </div> |
| 24 | + </template> |
| 25 | + <script> |
| 26 | + export default { |
| 27 | + name: "$1", |
| 28 | + data: function data() { |
| 29 | + return { |
| 30 | +
|
| 31 | + } |
| 32 | + } |
| 33 | + } |
| 34 | + </script> |
| 35 | + <style> |
| 36 | + </style> |
| 37 | + """ |
| 38 | + "description": "Single file component" |
| 39 | + "descriptionMoreURL": "https://vuejs.org/v2/guide/single-file-components.html" |
| 40 | + |
| 41 | +".meta.tag.block.any.html": |
| 42 | + 'v-for': |
| 43 | + 'prefix': 'v-for' |
| 44 | + 'body': 'v-for=\"${1:elem} in ${2:elemArray}\"' |
| 45 | + 'description': 'Vuejs binding for list rendering' |
| 46 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/list.html#v-for' |
| 47 | + 'v-if': |
| 48 | + 'prefix': 'v-if' |
| 49 | + 'body': 'v-if=\"${1:condition}\"' |
| 50 | + 'description': 'Vuejs binding for if conditional rendering' |
| 51 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/conditional.html#v-if' |
| 52 | + 'v-show': |
| 53 | + 'prefix': 'v-show' |
| 54 | + 'body': 'v-if=\"${1:condition}\"' |
| 55 | + 'description': 'Vuejs binding for if conditional rendering' |
| 56 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/conditional.html#v-show' |
| 57 | + 'v-else-if': |
| 58 | + 'prefix': 'v-if' |
| 59 | + 'body': 'v-else-if=\"${1:condition}\"' |
| 60 | + 'description': 'Vuejs binding for else-if conditional rendering' |
| 61 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/conditional.html#v-else-if' |
| 62 | + 'v-else': |
| 63 | + 'prefix': 'v-else' |
| 64 | + 'body': 'v-else' |
| 65 | + 'description': 'Vuejs binding for else conditional rendering' |
| 66 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/conditional.html#v-else' |
| 67 | + 'v-model': |
| 68 | + 'prefix': 'v-model' |
| 69 | + 'body': 'v-model=\"${1:model}\"' |
| 70 | + 'description': 'Vuejs binding for model binding' |
| 71 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/forms.html' |
| 72 | + |
| 73 | +'.source.js': |
| 74 | + 'Vue computed': |
| 75 | + 'prefix': 'vcomputed' |
| 76 | + 'body': """ |
| 77 | + computed: { |
| 78 | + ${1:computedProperty}: function ${1:computedProperty}() { |
| 79 | + return ${2:something} |
| 80 | + } |
| 81 | + } |
| 82 | + """ |
| 83 | + 'description': 'Vuejs computed property' |
| 84 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/computed.html' |
| 85 | + 'beforeCreate Vuejs hook': |
| 86 | + 'prefix': 'beforeCreate' |
| 87 | + 'body': """ |
| 88 | + beforeCreate: function beforeCreate() { |
| 89 | + //do something before creating vue instance |
| 90 | + } |
| 91 | + """ |
| 92 | + 'description': 'Vuejs instance lifecycle hook for beforeCreate' |
| 93 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram' |
| 94 | + 'created Vuejs hook': |
| 95 | + 'prefix': 'created' |
| 96 | + 'body': """ |
| 97 | + created: function created() { |
| 98 | + //do something after creating vue instance |
| 99 | + } |
| 100 | + """ |
| 101 | + 'description': 'Vuejs instance lifecycle hook for created' |
| 102 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram' |
| 103 | + 'beforeMount Vuejs hook': |
| 104 | + 'prefix': 'beforeMount' |
| 105 | + 'body': """ |
| 106 | + beforeMount: function beforeMount() { |
| 107 | + //do something before mounting vue instance |
| 108 | + } |
| 109 | + """ |
| 110 | + 'description': 'Vuejs instance lifecycle hook for beforeMount' |
| 111 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram' |
| 112 | + 'mounted Vuejs hook': |
| 113 | + 'prefix': 'mounted' |
| 114 | + 'body': """ |
| 115 | + mounted: function mounted() { |
| 116 | + //do something after mounting vue instance |
| 117 | + } |
| 118 | + """ |
| 119 | + 'description': 'Vuejs instance lifecycle hook for mounted' |
| 120 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram' |
| 121 | + 'beforeUpdate Vuejs hook': |
| 122 | + 'prefix': 'beforeUpdate' |
| 123 | + 'body': """ |
| 124 | + beforeUpdate: function beforeUpdate() { |
| 125 | + //do something before updating vue instance |
| 126 | + } |
| 127 | + """ |
| 128 | + 'description': 'Vuejs instance lifecycle hook for beforeUpdate' |
| 129 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram' |
| 130 | + 'updated Vuejs hook': |
| 131 | + 'prefix': 'updated' |
| 132 | + 'body': """ |
| 133 | + updated: function updated() { |
| 134 | + //do something after updating vue instance |
| 135 | + } |
| 136 | + """ |
| 137 | + 'description': 'Vuejs instance lifecycle hook for updated' |
| 138 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram' |
| 139 | + 'beforeDestroy Vuejs hook': |
| 140 | + 'prefix': 'beforeDestroy' |
| 141 | + 'body': """ |
| 142 | + beforeDestroy: function beforeDestroy() { |
| 143 | + //do something before destroying vue instance |
| 144 | + } |
| 145 | + """ |
| 146 | + 'description': 'Vuejs instance lifecycle hook for beforeDestroy' |
| 147 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram' |
| 148 | + 'destroyed Vuejs hook': |
| 149 | + 'prefix': 'destroyed' |
| 150 | + 'body': """ |
| 151 | + destroyed: function destroyed() { |
| 152 | + //do something after destroying vue instance |
| 153 | + } |
| 154 | + """ |
| 155 | + 'description': 'Vuejs instance lifecycle hook for destroyed' |
| 156 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram' |
| 157 | + 'Vue watch': |
| 158 | + 'prefix': 'vwatch' |
| 159 | + 'body': """ |
| 160 | + watch: { |
| 161 | + ${1:propertyToWatch}: function ${1:propertyToWatch}Watcher() { |
| 162 | + //do something when ${1:propertyToWatch} value changes |
| 163 | + } |
| 164 | + } |
| 165 | + """ |
| 166 | + 'description': 'Vuejs way to watch instance properties' |
| 167 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/computed.html#Watchers' |
| 168 | + 'Vuejs methods': |
| 169 | + 'prefix': 'methods' |
| 170 | + 'body': """ |
| 171 | + methods: { |
| 172 | + ${{1:methodName}}: function ${{1:methodName}}() { |
| 173 | +
|
| 174 | + } |
| 175 | + } |
| 176 | + """ |
| 177 | + 'description': 'Vuejs methods event handlers' |
| 178 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/events.html#Method-Event-Handlers' |
| 179 | + 'Vuejs components include': |
| 180 | + 'prefix': 'components' |
| 181 | + 'body': """ |
| 182 | + components: { |
| 183 | + ${1:componentName} |
| 184 | + } |
| 185 | + """ |
| 186 | + 'description': 'Use it when you want to add child components to parent component.' |
| 187 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/single-file-components.html' |
| 188 | + 'Vuejs props': |
| 189 | + 'prefix': 'props' |
| 190 | + 'body': 'props: [\'${1:propName}\']' |
| 191 | + 'description': 'Vuejs way to pass data to child components' |
| 192 | + 'descriptionMoreURL': 'https://vuejs.org/v2/guide/components.html#Props' |
0 commit comments