Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set
| `vstore-import` | Import vuex store into main.js |
| `vstore2` | Updated Base for Vuex store |

### Pinia

| Snippet | Purpose |
| --------------- | ------------------------------ |
| `v-pinia-store` | Base for Pinia store |

### Vue Router

| Snippet | Purpose |
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
"language": "javascript",
"path": "./snippets/vue-script-vuex.json"
},
{
"language": "javascript",
"path": "./snippets/vue-script-pinia.json"
},
{
"language": "javascript",
"path": "./snippets/vue-script-router.json"
Expand All @@ -72,6 +76,10 @@
"language": "typescript",
"path": "./snippets/vue-script-vuex.json"
},
{
"language": "typescript",
"path": "./snippets/vue-script-pinia.json"
},
{
"language": "typescript",
"path": "./snippets/vue-script-router.json"
Expand Down
24 changes: 24 additions & 0 deletions snippets/vue-script-pinia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"Pinia Store Boilerplate": {
"prefix": "v-pinia-store",
"body": [
"import { defineStore, acceptHMRUpdate } from \"pinia\";",
"",
"export const use$TM_FILENAME_BASE = defineStore(\"$TM_FILENAME_BASE\", {",
" state: () => {",
" return {",
" $0",
" };",
" },",
" getters: {},",
" actions: {},",
"});",
"",
"if (import.meta.hot) {",
" import.meta.hot.accept(acceptHMRUpdate(use$TM_FILENAME_BASE, import.meta.hot));",
"}",
""
],
"description": "Bootstrap the code needed for a Vue.js Pinia store file"
}
}