Skip to content

Commit bad5b5c

Browse files
committed
✏️ Remove modal snippets and insert new snippets
1 parent 09f9be5 commit bad5b5c

File tree

1 file changed

+32
-40
lines changed

1 file changed

+32
-40
lines changed

snippets/vue-components.cson

Lines changed: 32 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
'.text.html.vue':
1+
'.text.html.vue, .js':
22
'Vue Component':
33
'prefix': 'component'
44
'description': 'This snippet generates the basic structure for a Vue JS Component'
55
'body': """
66
<template>
7-
//You component contents goes here, only html.
7+
//You component contents goes here
88
</template>
99
1010
<script>
@@ -31,44 +31,36 @@
3131
}
3232
</script>
3333
"""
34-
'Vue Component Modal':
35-
'prefix': 'modal'
36-
'description': 'This snippet generates the basic structure for a Vue JS Component with a modal'
34+
'Vue Validator':
35+
'prefix': 'validator'
36+
'description': 'This snippet generates a validator function to Vue Validator'
3737
'body': """
38-
<template>
39-
<modal :show.sync="showModal">
40-
<h2 slot="header">{{$t("change_password.title")}}</h2>
41-
<div slot="body">
42-
//You component contents goes here, only html.
43-
</div>
44-
<div slot="footer" class="text-center">
45-
</div>
46-
</modal>
47-
</template>
48-
49-
<script>
50-
import Modal from './interface/Modal.vue'
51-
52-
export default {
53-
name: "ComponentName",
54-
components: { Modal },
55-
data(){
56-
return {
57-
//Component Data
58-
showModal: false,
59-
}
60-
},
61-
62-
created(){
63-
//On Component created
64-
this.showModal = true;
65-
},
66-
67-
methods: {
68-
functionExample(){
69-
//Basic Component method
70-
}
71-
}
38+
Vue.validator("validatorName", function (val) {
39+
return true
40+
});
41+
"""
42+
'Vue Validator Local':
43+
'prefix': 'validators'
44+
'description': 'This snippet generates a local validator function'
45+
'body': """
46+
validators: {
47+
nameOfValidator: function (val) {
48+
return true
7249
}
73-
</script>
50+
};
51+
"""
52+
'Vue Router Map':
53+
'prefix': 'map'
54+
'description': 'This snippet generates a Vue Router map function'
55+
'body': """
56+
router.map({
57+
'/example': {
58+
component: Example,
59+
subRoutes:{
60+
'/subrouter': {
61+
component: SubRouter
62+
}
63+
}
64+
}
65+
})
7466
"""

0 commit comments

Comments
 (0)