IDE:vscode的vue3模板

快捷键打开配置选项:ctrl + shift + p

选择配置文件:Snippet: Configure Snippets

javascript 复制代码
{
	// Place your snippets for vue here. Each snippet is defined under a snippet name and has a prefix, body and 
	// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
	// same ids are connected.
	// Example:
	// "Print to console": {
	// 	"prefix": "log",
	// 	"body": [
	// 		"console.log('$1');",
	// 		"$2"
	// 	],
	// 	"description": "Log output to console"
	// }

	
  "Vue 3 Setup Template": {
	// 快捷键设置。
    "prefix": "vue3",

    "body": [
		"<template>",
		"    <div class=\"${TM_FILENAME_BASE}\">",
		"        $0",
		"    </div>",
		"</template>",
		"",

		"<script lang=\"ts\">",
		"    export default {",
		"        name: 'MODULE NAME'",
		"    }",
		"",
		"</script>",
		"",

		"<script lang=\"ts\" setup>",
		"    import { ref } from 'vue'",

		"    $1",
		"</script>",
		"",

		"<style scoped>",
		"",
		"</style>"
    ],

    "description": "Vue 3 Composition API"
  }

}
相关推荐
竹林81843 分钟前
用 wagmi v2 和 viem 手写 NFT 市场批量上架功能,我踩遍了所有异步坑
javascript
zithern_juejin1 小时前
数组扁平化
javascript
清溪5491 小时前
n8n表达式沙箱逃逸至RCE漏洞-CVE-2025-68613复现
javascript·安全
Hilaku1 小时前
多标签页并发请求导致 Token 刷新失败?只有 15行代码就能解决 !
前端·javascript·程序员
烛衔溟1 小时前
TypeScript 类的静态成员与静态方法
开发语言·javascript·typescript
Nile1 小时前
解密Palantir系列一:4. Ontology 不是哲学
开发语言·前端·javascript
Highcharts1 小时前
如何创建蛛网地图|气泡事件+全球发布+关联组合图表开发示例
javascript
xier1234562 小时前
three-instance-batch 开发笔记
javascript·three.js
王林不想说话2 小时前
TypeScript 进阶知识总结:从 extends、泛型到 infer,一篇打通 TS 类型系统
前端·javascript·typescript
罗超驿2 小时前
15.JavaScript 函数与作用域完全指南:语法、参数、表达式与作用域链实战
开发语言·前端·javascript