vscode vue add code snippet

vscode vue add code snippet

#Step 1: Enter the main interface of vs code –> use the shortcut key "ctrl + shift + p":

insert image description here
If the option Configure User Snippets does not appear on the first line, then you can enter: Configure User Snippets in the search bar, and then you can find this option.

#The second step selects or creates vue.json

insert image description here
insert image description here
#Step 3: Configure the code

"Print to console": {
		"prefix": "vue",
		"body": [
			"<template>",
			"  <div>",
			"  </div>",
			"</template>",
			"",
			"<script>",
			"  export default {",
			"  data() {",
			"    return {",
			"",
			"    };",
			"  },",
			"  created() {",
			"",
			"  },",
			"  mounted() {",
			"",
			"  },",
			"  methods: {",
			"",
			"  },",
			"}",
			"</script>",
			"",
			"<style lang='scss' scoped>",
			"$4",
			"</style>"
		],
		"description": "Log output to console"
	}

insert image description here

Guess you like

Origin blog.csdn.net/z1712636234/article/details/105975952