Skip to content

Commit e7d4ce8

Browse files
committed
Adjust snippet for the Nuxt error handling
1 parent d17f6a1 commit e7d4ce8

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to the "nuxt-vscode-snippets" extension will be documented i
44

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

7+
## 2.3.1
8+
9+
### Fixes
10+
11+
- Adjust snippet for the Nuxt error handling
12+
713
## 2.3.0
814

915
### Added

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Nuxt VS Code Snippets",
44
"description": "Supercharge your Nuxt development with powerful snippets",
55
"icon": "images/nuxt-logo.png",
6-
"version": "2.3.0",
6+
"version": "2.3.1",
77
"publisher": "zhaolinlau",
88
"license": "MIT",
99
"author": {
@@ -40,7 +40,7 @@
4040
},
4141
"scripts": {
4242
"build": "vsce package -o nuxt-vscode-snippets-$npm_package_version.vsix",
43-
"install": "pnpm build && code --install-extension nuxt-vscode-snippets-$npm_package_version.vsix"
43+
"install": "npm run build && code --install-extension nuxt-vscode-snippets-$npm_package_version.vsix"
4444
},
4545
"contributes": {
4646
"languages": [

snippets/nuxt/nuxt-script.code-snippets

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,28 +225,34 @@
225225
"Nuxt useError": {
226226
"prefix": "nerr",
227227
"body": [
228-
"useError()"
228+
"const error = useError()"
229229
],
230230
"description": "Nuxt useError composable"
231231
},
232232
"Nuxt createError": {
233233
"prefix": "ncerr",
234234
"body": [
235-
"throw createError(${0:err})"
235+
"createError({",
236+
"\tstatusCode: ${1},",
237+
"\tstatusMessage: ${2}",
238+
"})"
236239
],
237240
"description": "Nuxt createError utility"
238241
},
239242
"Nuxt showError": {
240243
"prefix": "nshwerr",
241244
"body": [
242-
"showError(${0:error})"
245+
"showError({",
246+
"\tstatusCode: ${1},",
247+
"\tstatusMessage: ${2}",
248+
"})"
243249
],
244250
"description": "Nuxt showError utility"
245251
},
246252
"Nuxt clearError": {
247253
"prefix": "nclrerr",
248254
"body": [
249-
"clearError(${0:options})"
255+
"clearError({ redirect: ${0}})"
250256
],
251257
"description": "Nuxt clearError utility"
252258
},

0 commit comments

Comments
 (0)