From cefd89697300840b0d3efbaf67a257c9bfcb447c Mon Sep 17 00:00:00 2001 From: Lancine Doumbia <107377652+ldoum@users.noreply.github.com> Date: Wed, 15 Jun 2022 01:02:08 -0400 Subject: [PATCH 1/5] Added a snippet for the Vue Router snippet section Hello there! I had installed your VS code extension days ago and I thought that the extension was very handy. So I wanted to make my first contribution. Feel free to comment if you have any suggestions --- snippets/vue-script-router.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/snippets/vue-script-router.json b/snippets/vue-script-router.json index 9f584df..2dc586a 100644 --- a/snippets/vue-script-router.json +++ b/snippets/vue-script-router.json @@ -87,5 +87,16 @@ "}," ], "description": "Vue Router route with per route code-splitting" - } + }, + "Vue route blob": { + "prefix": ["vroute-blob"], + "body": [ + "{", + "\tpath: \"/${1:pathName}\",", + "\tname: \"${2:routeName}\",", + "\tcomponent: ${3:componentName},", + "}", + ], + "description": "Vue Router route blob" + }, } From 0c9d1ad1119e24acbe554b2a5b363236ba50c0e0 Mon Sep 17 00:00:00 2001 From: Lancine Doumbia <107377652+ldoum@users.noreply.github.com> Date: Wed, 15 Jun 2022 01:06:03 -0400 Subject: [PATCH 2/5] There were too many whitespaces on my snippet. Made it look neater --- snippets/vue-script-router.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/snippets/vue-script-router.json b/snippets/vue-script-router.json index 2dc586a..8fdf66f 100644 --- a/snippets/vue-script-router.json +++ b/snippets/vue-script-router.json @@ -89,14 +89,14 @@ "description": "Vue Router route with per route code-splitting" }, "Vue route blob": { - "prefix": ["vroute-blob"], - "body": [ - "{", - "\tpath: \"/${1:pathName}\",", - "\tname: \"${2:routeName}\",", - "\tcomponent: ${3:componentName},", - "}", - ], - "description": "Vue Router route blob" - }, + "prefix": ["vroute-blob"], + "body": [ + "{", + "\tpath: \"/${1:pathName}\",", + "\tname: \"${2:routeName}\",", + "\tcomponent: ${3:componentName},", + "}", + ], + "description": "Vue Router route blob" + }, } From e1a9db6934ce48bc51be1602f4d9918855148de6 Mon Sep 17 00:00:00 2001 From: Lancine Doumbia <107377652+ldoum@users.noreply.github.com> Date: Wed, 15 Jun 2022 01:17:46 -0400 Subject: [PATCH 3/5] Added a prefix on the Vue Router table Prefix: vroute-blob --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f440a8f..38f66c4 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,7 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set | `vbeforerouteenter` | Vue Router component guards beforeRouteEnter | | `vbeforerouteupdate` | Vue Router component guards beforeRouteUpdate | | `vbeforerouteleave` | Vue Router component guards beforeRouteLeave | +| `vroute-blob` | Vue Router route object for a webpage | ### Vue Config From f09408128424bc406cefe28ff46c93d8183e329c Mon Sep 17 00:00:00 2001 From: Lancine Doumbia <107377652+ldoum@users.noreply.github.com> Date: Wed, 15 Jun 2022 01:32:38 -0400 Subject: [PATCH 4/5] Added 5 new snippets Thought it would help tweak the extension a bit by allowing users to summon extra functions in the computed and methods options without the boilerplate. An improvement of the Vue methods and Vue computed snippets. The Vue blank api snippet is a bonus one, totally optional. --- snippets/vue-script.json | 48 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/snippets/vue-script.json b/snippets/vue-script.json index 2abfffe..360d05c 100644 --- a/snippets/vue-script.json +++ b/snippets/vue-script.json @@ -418,5 +418,51 @@ "}" ], "description": "Use Composition API within Options API" - } + }, + "Vue extra method function": { + "prefix": ["vfunc-m"], + "body": [ + "${1:funcName}(){", + "\t${2:JSExpr}", + "}", + ], + "description": "Extra Vue Method function" + }, + "Vue extra method function w argumemt": { + "prefix": ["vfunc-m-arg"], + "body": [ + + "${1:funcName}(${3:argLine}){", + "\t${2:JSExpr}", + "}", + ], + "description": "Extra Vue Method function with argument" + }, + "Vue extra computed function": { + "prefix": ["vfunc-c"], + "body": [ + "${1:funcName}(){", + "\treturn ${2:JSExpr}", + "}", + ], + "description": "Extra Vue Computed function" + }, + "Vue extra computed function w argument": { + "prefix": ["vfunc-c-arg"], + "body": [ + "${1:funcName}(${3:argLine}){", + "\treturn ${2:JSExpr}", + "}", + ], + "description": "Extra Vue Computed function with argument" + }, + "Vue empty api body": { + "prefix": ["vapi-shell"], + "body": [ + "export default {", + "\t/*Define your API here please*/", + "};", + ], + "description": "Vue blank api" + }, } From a9f035ecfae22d90912bfa228cb65dee742ef241 Mon Sep 17 00:00:00 2001 From: Lancine Doumbia <107377652+ldoum@users.noreply.github.com> Date: Wed, 15 Jun 2022 01:39:41 -0400 Subject: [PATCH 5/5] Added 5 new prefixes and purposes to script --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 38f66c4..bd32541 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,11 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set | `vcommit` | Commit to Vuex store in methods for mutation | | `vdispatch` | Dispatch to Vuex store in methods for action | | `vtest` | A simple unit testing component | +| `vfunc-m` | Extra method function | +| `vfunc-m-arg` | Extra method function with arguments | +| `vfunc-c` | Extra computed function | +| `vfunc-c-arg` | Extra computed function with arguments | +| `vapi-shell` | Empty export default function | ### Vue Composition API