vscode自定义代码块

vscode自定义代码块

  • Post Author:
  • Post Category:工具
  • Post Comments:2评论

记录一下

vscode自定义代码块的方法
1.文件—》首选项—》用户片段在这里插入图片描述
2.在这里插入图片描述
3.将代码复制过去

{
	"Print to console": {
		"prefix": "vue",
		"body": [
			"<div id='app'></div>",
			"",
			"<script src='../js/vue.js'>",
			"</script>",
			"<script>",
			" const app = Vue.createApp({",
			"   data() {",
			"return{",
			"}",
			"   },",
			"   methods: {}",
			"}).mount('#app')",
			"</script>",
		],
		"description": "Log output to console"
	}
}

4.在需要的地方输入vue然后按tab或者enter
在这里插入图片描述
5.效果
在这里插入图片描述

这篇文章有 2 个评论

  1. Earn Online

    Wow, incredible weblog layout! How lengthy have you been running a blog for? you made running a blog glance easy. The full glance of your web site is great, let alone the content!!

  2. Facebook Marketing

    Wow, awesome weblog layout! How long have you been blogging for? you made blogging glance easy. The whole glance of your site is excellent, let alone the content!!

发表评论