VueJS Snippets for Atom
- .text.html.vue
- .text.js
prefix: component
body:
<template>
//You component contents goes here, only html.
</template>
<script>
export default {
name: "ComponentName",
data(){
return {
//Component Data
example: true,
foo: "bar"
}
},
created(){
//On Component created
},
methods: {
functionExample(){
//Basic Component method
}
}
}
</script>
prefix: validator
body:
Vue.validator("validatorName", function (val) {
return true
});
prefix: validators
body:
[..]
validators: {
nameOfValidator: function (val) {
return true
}
},
[...]
prefix: map
body:
router.map({
'/example': {
component: Example,
subRoutes:{
'/subrouter': {
component: SubRouter
}
}
}
})
prefix: get
body:
this.$http.get(URL).then((result) => {
}, (error) => {
})
})
prefix: post
body:
this.$http.post(URL, PARAMS).then((response) => {
}, (error) => {
})
prefix: put
body:
this.$http.put(URL, PARAMS).then((response) => {
}, (error) => {
})
prefix: delete
body:
this.$http.delete(URL, PARAMS).then((response) => {
}, (error) => {
})