From a57c18143c76bbe8e8907acdeba6efe1cef4efb9 Mon Sep 17 00:00:00 2001 From: Stefano Orioli Date: Fri, 13 Dec 2024 11:30:39 +0100 Subject: [PATCH] Added shortcut for $t funcion of vue i18n, also removed duplicated entries. Updated readme. --- README.md | 1 + snippets/vue-template.json | 13 ++++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b71ff08..4d9d436 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ These snippets are meant to provide a base scaffold for your single file compone | `vroutepath` | router-link Path Routing Link | | `vemit-child` | Emit event from child component | | `vemit-parent` | Emit event to parent component | +| `vi18n` | Vue i18n shortcut for $t | ### Script diff --git a/snippets/vue-template.json b/snippets/vue-template.json index 4635855..bf8fa5c 100644 --- a/snippets/vue-template.json +++ b/snippets/vue-template.json @@ -123,14 +123,9 @@ "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" + "Vue i18n shortcut": { + "prefix": "vi18n", + "body": ["{{ $$t('${1:key}') }}"], + "description": "Vue i18n shortcut for $t" } } \ No newline at end of file