4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VSCodeでvue-property-decorator使用時のsnippet作成

Last updated at Posted at 2019-08-05

vue-property-decoratorの使用時にVSCode拡張機能のVeturのsnippetがいい感じに機能してくれないので作成。

macの場合

  1. Code->基本設定->ユーザースニペットからvue-htmlを選択
  2. 以下のjsonを貼り付けて保存

{
	"vue-property-decorator": {
		"prefix": "vpd",
		"body": [
			"<template>",
			"\t$0",
			"</template>",
			"",
			"<script lang=\"ts\">",
			"import { Vue, Component } from 'vue-property-decorator'",
			"",
			"@Component",
			"export default class $TM_FILENAME_BASE extends Vue {}",
			"</script>",
			"",
			"<style lang=\"scss\" scoped></style>",
			""
		],
		"description": "vue-property-decorator snippet"
	}
}

vueファイル上でvpdをタイプするとスニペットが出てきます。

確認してませんがWindowsも同じ手順で設定できると思います。
細かい部分は自分好みに修正すると良いと思います。

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?