vscode配置vue模板

ctrl+p全局搜索 “>配置用户代码片段”,再输入“vue”,回车,copy,搞定!

{
	"生成vue模板": {
		"prefix": "vue",
		"body": [
			"<template>",
			"  <div>",
			"    ",
			"  </div>",
			"</template>",
			"",
			"<script>",
			"export default {",
			"  components: {},",
			"  props: {},",
			"  data() {",
			"    return {",
			"      ",
			"    };",
			"  },",
			"  computed: {",
			"    ",
			"  },",
			"  watch: {",
			"    ",
			"  },",
			"  methods: {",
			"    ",
			"  }",
			"};",
			"</script>",
			"<style lang=\"less\" scoped>",
			"",
			"</style>"
		],
		"description": "生成vue模板"
	}
}

根据引用\[1\]和引用\[2\]的内容,你可以通过在VSCode中的用户代码片段配置文件中添加相应的代码块来配置Vue代码块。你可以使用以下示例代码作为参考: ```json { "Print5 to console": { "prefix": "vue", "body": \[ "<!-- 文件名:'$TM_FILENAME_BASE'-->", "<!-- 当前文档的完整文件路径:'$TM_FILEPATH'-->", "<template>", "\t<div>", "\t</div>", "</template>", "<script lang=\"ts\" setup>", "</script>", "<style lang=\"scss\">", "</style>" \], "description": "Log output to console" } } ``` 将上述代码添加到你的用户代码片段配置文件中后,你可以在Vue文件中输入"vue",然后按下回车键,就会生成对应的代码块。这个代码块包含了Vue文件的基本结构,包括模板、脚本和样式部分。你也可以根据需要进行修改和扩展。 #### 引用[.reference_title] - *1* [VScode 如何配置vue代码片段](https://blog.csdn.net/Steven_Son/article/details/126483081)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [vscode配置vue默认代码片段](https://blog.csdn.net/weixin_43974125/article/details/129260245)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值