Skip to content

Commit 42f0c3d

Browse files
authored
Merge pull request sdras#51 from sdras/vuex-changes
new version of vuex store, increment version, fix readme spacing
2 parents d9f3d22 + d68a20b commit 42f0c3d

File tree

4 files changed

+141
-100
lines changed

4 files changed

+141
-100
lines changed

CHANGELOG.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,34 @@ All notable changes to the "vue-vscode-snippets" extension will be documented in
44

55
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
66

7+
## 1.7.0
8+
9+
- Add in vue-router snippets
10+
- Add trailing comma on vmixin
11+
- Add in updated way to write Vuex store
12+
713
## 1.6.0
814

9-
* Fix bug in `vcomputed`
10-
* Fix bug in vbase that was defaulting to ts
15+
- Fix bug in `vcomputed`
16+
- Fix bug in vbase that was defaulting to ts
1117

1218
## 1.5.0
1319

14-
* Support for mapState, mapGetters, mapMutations, mapActions
15-
* Support for vue.config.js
20+
- Support for mapState, mapGetters, mapMutations, mapActions
21+
- Support for vue.config.js
1622

1723
## 1.4.0
1824

19-
* Lifecycle methods
20-
* Vuex scaffold
21-
* TypeScript
25+
- Lifecycle methods
26+
- Vuex scaffold
27+
- TypeScript
2228

2329
## 1.3.0
2430

25-
* Add nuxt and dist to .gitignore
26-
* Add in testing snippet
27-
* Make component imports consistent
31+
- Add nuxt and dist to .gitignore
32+
- Add in testing snippet
33+
- Make component imports consistent
2834

2935
## 1.0.0
3036

31-
* Initial release
37+
- Initial release

README.md

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -32,108 +32,108 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set
3232

3333
### Vue
3434

35-
Snippet | Purpose
36-
---------- | ------------------------------------------
37-
`vbase` | Single file component base
38-
`vbase-ts` | Single file component base with Typescript
39-
35+
| Snippet | Purpose |
36+
| ---------- | ------------------------------------------ |
37+
| `vbase` | Single file component base |
38+
| `vbase-ts` | Single file component base with Typescript |
4039

4140
### Template
4241

43-
Snippet | Purpose
44-
----------------- | -----------------------------------
45-
`vfor` | v-for directive
46-
`vmodel` | Semantic v-model directive
47-
`vmodel-num` | Semantic v-model number directive
48-
`von` | v-on click handler with arguments
49-
`vel-props` | Component element with props
50-
`vsrc` | Image src binding
51-
`vstyle` | Inline style binding
52-
`vstyle-obj` | Inline style binding with objects
53-
`vclass` | Class binding
54-
`vclass-obj` | Class binding with objects
55-
`vclass-obj-mult` | Multiple conditional class bindings
56-
`vanim` | Transition component with JS hooks
57-
`vnuxtl` | Nuxt Routing Link
58-
`vroutename` | router-link Named Routing
59-
`vroutenameparam` | router-link Named with Parameters
60-
`vroutepath` | router-link Path Routing Link
42+
| Snippet | Purpose |
43+
| ----------------- | ----------------------------------- |
44+
| `vfor` | v-for directive |
45+
| `vmodel` | Semantic v-model directive |
46+
| `vmodel-num` | Semantic v-model number directive |
47+
| `von` | v-on click handler with arguments |
48+
| `vel-props` | Component element with props |
49+
| `vsrc` | Image src binding |
50+
| `vstyle` | Inline style binding |
51+
| `vstyle-obj` | Inline style binding with objects |
52+
| `vclass` | Class binding |
53+
| `vclass-obj` | Class binding with objects |
54+
| `vclass-obj-mult` | Multiple conditional class bindings |
55+
| `vanim` | Transition component with JS hooks |
56+
| `vnuxtl` | Nuxt Routing Link |
57+
| `vroutename` | router-link Named Routing |
58+
| `vroutenameparam` | router-link Named with Parameters |
59+
| `vroutepath` | router-link Path Routing Link |
6160

6261
### Script
6362

64-
Snippet | Purpose
65-
---------------- | ------------------------------------------------------------------------
66-
`vdata` | Component data as a function
67-
`vmethod` | Vue method
68-
`vcomputed` | Vue computed property
69-
`vwatcher` | Vue watcher with new and old value args
70-
`vbeforecreate` | beforeCreate lifecycle method
71-
`vcreated` | created lifecycle method
72-
`vbeforemount` | beforeMount lifecycle method
73-
`vmounted` | vmounted lifecycle method
74-
`vbeforeupdate` | beforeUpdate lifecycle method
75-
`vupdated` | updated lifecycle method
76-
`vbeforedestroy` | beforeDestroy lifecycle method
77-
`vdestroyed` | destroyed lifecycle method
78-
`vprops` | Props with type and default
79-
`vimport` | Import one component into another
80-
`vcomponents` | Import one component into another within the export statement
81-
`vimport-export` | Import one component into another and use it within the export statement
82-
`vmapstate` | import mapState from Vuex into vue component component
83-
`vmapgetters` | import mapGetters from Vuex into vue component component
84-
`vmapmutations` | import mapMutations from Vuex into vue component component
85-
`vmapactions` | import mapActions from Vuex into vue component component
86-
`vfilter` | Vue filter
87-
`vmixin` | Create a Vue Mixin
88-
`vmixin-use` | Bring a mixin into a component to use
89-
`vc-direct` | Vue create a custom directive
90-
`vimport-lib` | Import a library
91-
`vimport-gsap` | Import GreenSock with Timeline and Eases
92-
`vanimhook-js` | Using the Transition component JS hooks in methods
93-
`vcommit` | Commit to Vuex store in methods for mutation
94-
`vdispatch` | Dispatch to Vuex store in methods for action
95-
`vtest` | A simple unit testing component
96-
`vinc` | incrementer
97-
`vdec` | decrementer
98-
`vconfig` | vue.config.js file, example imports a sass file into every component
63+
| Snippet | Purpose |
64+
| ---------------- | ------------------------------------------------------------------------ |
65+
| `vdata` | Component data as a function |
66+
| `vmethod` | Vue method |
67+
| `vcomputed` | Vue computed property |
68+
| `vwatcher` | Vue watcher with new and old value args |
69+
| `vbeforecreate` | beforeCreate lifecycle method |
70+
| `vcreated` | created lifecycle method |
71+
| `vbeforemount` | beforeMount lifecycle method |
72+
| `vmounted` | vmounted lifecycle method |
73+
| `vbeforeupdate` | beforeUpdate lifecycle method |
74+
| `vupdated` | updated lifecycle method |
75+
| `vbeforedestroy` | beforeDestroy lifecycle method |
76+
| `vdestroyed` | destroyed lifecycle method |
77+
| `vprops` | Props with type and default |
78+
| `vimport` | Import one component into another |
79+
| `vcomponents` | Import one component into another within the export statement |
80+
| `vimport-export` | Import one component into another and use it within the export statement |
81+
| `vmapstate` | import mapState from Vuex into vue component component |
82+
| `vmapgetters` | import mapGetters from Vuex into vue component component |
83+
| `vmapmutations` | import mapMutations from Vuex into vue component component |
84+
| `vmapactions` | import mapActions from Vuex into vue component component |
85+
| `vfilter` | Vue filter |
86+
| `vmixin` | Create a Vue Mixin |
87+
| `vmixin-use` | Bring a mixin into a component to use |
88+
| `vc-direct` | Vue create a custom directive |
89+
| `vimport-lib` | Import a library |
90+
| `vimport-gsap` | Import GreenSock with Timeline and Eases |
91+
| `vanimhook-js` | Using the Transition component JS hooks in methods |
92+
| `vcommit` | Commit to Vuex store in methods for mutation |
93+
| `vdispatch` | Dispatch to Vuex store in methods for action |
94+
| `vtest` | A simple unit testing component |
95+
| `vinc` | incrementer |
96+
| `vdec` | decrementer |
97+
| `vconfig` | vue.config.js file, example imports a sass file into every component |
9998

10099
### Vuex
101100

102-
Snippet | Purpose
103-
--------------- | ------------------------------
104-
`vstore` | Base for Vuex store.js
105-
`vgetter` | Vuex Getter
106-
`vmutation` | Vuex Mutation
107-
`vaction` | Vuex Action
108-
`vmodule` | Vuex Module
109-
`vstore-import` | Import vuex store into main.js
101+
| Snippet | Purpose |
102+
| --------------- | ------------------------------ |
103+
| `vstore` | Base for Vuex store.js |
104+
| `vgetter` | Vuex Getter |
105+
| `vmutation` | Vuex Mutation |
106+
| `vaction` | Vuex Action |
107+
| `vmodule` | Vuex Module |
108+
| `vstore-import` | Import vuex store into main.js |
109+
| `vstore2` | Updated Base for Vuex store |
110110

111111
### Vue Router
112112

113-
Snippet | Purpose
114-
-------------------- | ------------------------------
115-
`vrouter` | Base for Vue Router
116-
`vscrollbehavior` | Vue Router scrollBehavior
117-
`vbeforeeach` | Vue Router global guards beforeEach
118-
`vbeforeresolve` | Vue Router global guards beforeResolve
119-
`vaftereach` | Vue Router global guards afterEach
120-
`vbeforeenter` | Vue Router per-route guard beforeEnter
121-
`vbeforerouteenter` | Vue Router component guards beforeRouteEnter
122-
`vbeforerouteupdate` | Vue Router component guards beforeRouteUpdate
123-
`vbeforerouteleave` | Vue Router component guards beforeRouteLeave
113+
| Snippet | Purpose |
114+
| -------------------- | --------------------------------------------- |
115+
| `vrouter` | Base for Vue Router |
116+
| `vscrollbehavior` | Vue Router scrollBehavior |
117+
| `vbeforeeach` | Vue Router global guards beforeEach |
118+
| `vbeforeresolve` | Vue Router global guards beforeResolve |
119+
| `vaftereach` | Vue Router global guards afterEach |
120+
| `vbeforeenter` | Vue Router per-route guard beforeEnter |
121+
| `vbeforerouteenter` | Vue Router component guards beforeRouteEnter |
122+
| `vbeforerouteupdate` | Vue Router component guards beforeRouteUpdate |
123+
| `vbeforerouteleave` | Vue Router component guards beforeRouteLeave |
124124

125125
### Nuxt Config
126126

127-
Snippet | Purpose
128-
------- | -------------------------------------------------------
129-
`nfont` | link to include fonts in a nuxt project, in nuxt-config
130-
`ncss` | link to css assets such as normalize
127+
| Snippet | Purpose |
128+
| ------- | ------------------------------------------------------- |
129+
| `nfont` | link to include fonts in a nuxt project, in nuxt-config |
130+
| `ncss` | link to css assets such as normalize |
131131

132132
### Extra (plaintext)
133133

134-
Snippet | Purpose
135-
----------- | -----------------------
136-
`gitignore` | .gitignore file presets
134+
| Snippet | Purpose |
135+
| ----------- | ----------------------- |
136+
| `gitignore` | .gitignore file presets |
137137

138138
## Contributing
139139

package.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Vue VSCode Snippets",
44
"description": "Snippets that will supercharge your Vue workflow",
55
"icon": "images/vue-logo.png",
6-
"version": "1.6.0",
6+
"version": "1.7.0",
77
"publisher": "sdras",
88
"engines": {
99
"vscode": "^1.14.0"
@@ -16,9 +16,17 @@
1616
"build": "vsce package -o vue-vscode-snippets-$npm_package_version.vsix",
1717
"install": "yarn build && code --install-extension vue-vscode-snippets-$npm_package_version.vsix"
1818
},
19-
"keywords": ["Vue", "Vue 2", "Vue Snippets"],
20-
"extensionDependencies": ["octref.vetur"],
21-
"categories": ["Snippets"],
19+
"keywords": [
20+
"Vue",
21+
"Vue 2",
22+
"Vue Snippets"
23+
],
24+
"extensionDependencies": [
25+
"octref.vetur"
26+
],
27+
"categories": [
28+
"Snippets"
29+
],
2230
"contributes": {
2331
"snippets": [
2432
{

snippets/vue-script-vuex.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,32 @@
7878
"};"
7979
],
8080
"description": "vuex module"
81+
},
82+
"Vuex Store 2": {
83+
"prefix": "vstore2",
84+
"body": [
85+
"export const state = () => ({",
86+
"\tvalue: 'myvalue'",
87+
"})",
88+
"",
89+
"export const getters = {",
90+
"\tgetterValue: state => {",
91+
"\t\treturn state.value",
92+
"\t}",
93+
"}",
94+
"",
95+
"export const mutations = {",
96+
"\tupdateValue: (state, payload) => {",
97+
"\t\tstate.value = payload",
98+
"\t}",
99+
"}",
100+
"",
101+
"export const actions = {",
102+
"\tupdateActionValue: ({ commit }, payload) => {",
103+
"\t\tcommit('updateValue', payload)",
104+
"\t}",
105+
"}"
106+
],
107+
"description": "vuex store 2"
81108
}
82-
}
109+
}

0 commit comments

Comments
 (0)