Skip to content

Commit fa63274

Browse files
author
Corentin Andre
committed
First commit
Add package, snippets, gitignore, LICENSE, README
0 parents  commit fa63274

File tree

5 files changed

+239
-0
lines changed

5 files changed

+239
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.git

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Corentin.Andre
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Vuejs-snippets
2+
Collection of Vue.js snippets for version 2.0+

package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "vuejs-snippets",
3+
"version": "0.1.0",
4+
"description": "Vuejs 2.0+ snippets for Atom",
5+
"author": {
6+
"name": "Corentin Andre",
7+
"email": "candre@edu.ece.fr",
8+
"url": "https://github.com/CorentinAndre"
9+
},
10+
"keywords": [
11+
"Vuejs",
12+
"snippets",
13+
"Vuejs 2.0",
14+
"Vue"
15+
],
16+
"repository": "https://github.com/CorentinAndre/Vuejs-snippets",
17+
"license": "MIT",
18+
"engines": {
19+
"atom": ">=1.0.0"
20+
},
21+
"dependencies": {}
22+
}

snippets/snippets.cson

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
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

Comments
 (0)