Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cezardasilva/vuejs-snippets
VueJS Snippets for Atom
https://github.com/cezardasilva/vuejs-snippets
apm atom snippets vue vuejs-snippets
Last synced: 18 days ago
JSON representation
VueJS Snippets for Atom
- Host: GitHub
- URL: https://github.com/cezardasilva/vuejs-snippets
- Owner: cezardasilva
- License: mit
- Created: 2016-08-17T17:36:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-17T11:24:02.000Z (about 7 years ago)
- Last Synced: 2024-05-29T11:38:26.386Z (7 months ago)
- Topics: apm, atom, snippets, vue, vuejs-snippets
- Homepage:
- Size: 13.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Vue.js Snippets [![apm](https://img.shields.io/apm/dm/vuejs-snippets.svg)](https://atom.io/packages/vuejs-snippets) [![apm](https://img.shields.io/apm/l/vuejs-snippets.svg?)](https://atom.io/packages/vuejs-snippets) [![apm](https://img.shields.io/apm/v/vuejs-snippets.svg?)](https://atom.io/packages/vuejs-snippets)
Vue.js Snippets for Atom
## Types
- .text.html.vue
- .text.js## Snippets
### Vue Component
prefix: template
body:
```Vue
export default {
name: "YourComponentName",
data(){
return {
//Component Data
example: true,
foo: "bar"
}
},created(){
//On Component created
},methods: {
functionExample(){
//Basic Component method
}
}
}
```## Vue Router
### Router
prefix: router
body:
```javascript
import Vue from 'vue'
import VueRouter from 'vue-router'Vue.use(VueRouter)
const routes = [
{
name: "YourRouteName",
path: "/",
component: YourComponent
}
]export const router = new VueRouter({
routes: routes,
scrollBehavior (to, from, savedPosition) {
return { x: 0, y: 0 }
}
})
```## Vue filter
### New Filter
prefix: filter
body:
```javascript
Vue.filter('yourfiltername', (value) => {
return true
})
```
## Vue Resource### Get
prefix: get
body:
```javascript
this.$http.get(URL).then((result) => {}, (error) => {
})
})
```### Post
prefix: post
body:
```javascript
this.$http.post(URL, PARAMS).then((response) => {}, (error) => {
})
```### Put
prefix: put
body:
```javascript
this.$http.put(URL, PARAMS).then((response) => {}, (error) => {
})
```### Delete
prefix: delete
body:
```javascript
this.$http.delete(URL, PARAMS).then((response) => {}, (error) => {
})
```