From 1743ace88b8e4b496df12cfe8ebd2a5b951357fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eder=20D=C3=ADaz?= Date: Fri, 14 Aug 2020 00:50:06 -0500 Subject: [PATCH] :truck: Move emit snippets from script to template --- README.md | 4 ++-- snippets/vue-pug.json | 10 ++++++++++ snippets/vue-script.json | 10 ---------- snippets/vue-template.json | 10 ++++++++++ 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d4c03c3..413b837 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,8 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set | `vroutename` | router-link Named Routing | | `vroutenameparam` | router-link Named with Parameters | | `vroutepath` | router-link Path Routing Link | +| `vemit-child` | Emit event from child component | +| `vemit-parent` | Emit event to parent component | ### Script @@ -86,8 +88,6 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set | `vbeforedestroy` | beforeDestroy lifecycle method | | `vdestroyed` | destroyed lifecycle method | | `vprops` | Props with type and default | -| `vemit-child` | Emit event from child component | -| `vemit-parent` | Emit event tp parent component | | `vimport` | Import one component into another | | `vimport-dynamic` | Import one component that should be lazy loaded by webpack | | `vcomponents` | Import one component into another within the export statement | diff --git a/snippets/vue-pug.json b/snippets/vue-pug.json index a995ef6..d601d3a 100644 --- a/snippets/vue-pug.json +++ b/snippets/vue-pug.json @@ -82,5 +82,15 @@ "prefix": "vnuxtl", "body": ["nuxt-link(to=\"/${1:page}\") ${1:page}"], "description": "nuxt routing link" + }, + "Vue Emit from Child": { + "prefix": "vemit-child", + "body": ["@change=\"$emit('change', $event.target.value)\""], + "description": "Vue Emit from Child Component" + }, + "Vue Emit to Parent": { + "prefix": "vemit-parent", + "body": ["@change=\"${1:foo} = $event\""], + "description": "Vue Emit to Parent Component" } } diff --git a/snippets/vue-script.json b/snippets/vue-script.json index 7d45966..21b10d5 100644 --- a/snippets/vue-script.json +++ b/snippets/vue-script.json @@ -98,16 +98,6 @@ ], "description": "Vue Props with Default" }, - "Vue Emit from Child": { - "prefix": "vemit-child", - "body": ["@change=\"$emit('change', $event.target.value)\""], - "description": "Vue Emit from Child Component" - }, - "Vue Emit to Parent": { - "prefix": "vemit-parent", - "body": ["@change=\"${1:foo} = $event\""], - "description": "Vue Emit to Parent Component" - }, "Vue Import File": { "prefix": "vimport", "body": ["import ${1:New} from '@/components/${1:New}.vue';"], diff --git a/snippets/vue-template.json b/snippets/vue-template.json index 8e827d0..65d4a9c 100644 --- a/snippets/vue-template.json +++ b/snippets/vue-template.json @@ -112,5 +112,15 @@ "prefix": "vroutepath", "body": ["${2:LinkTitle}"], "description": "Path routing link" + }, + "Vue Emit from Child": { + "prefix": "vemit-child", + "body": ["@change=\"$emit('change', $event.target.value)\""], + "description": "Vue Emit from Child Component" + }, + "Vue Emit to Parent": { + "prefix": "vemit-parent", + "body": ["@change=\"${1:foo} = $event\""], + "description": "Vue Emit to Parent Component" } }