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"
  }

}
相关推荐
用户298698530141 小时前
在 React 中使用 JavaScript 将 Excel 转换为 PDF
javascript·react.js·webassembly
用户938515635074 小时前
从 Prompt 到 Harness:AI 工程化的三年跃迁与实战解码
javascript·人工智能
木木剑光4 小时前
我开源了一个 React 组件库,沉淀了多个高频组件和实用 Hooks
前端·javascript·react.js
竹林8185 小时前
Solana DApp 开发踩坑实录:从零用 @solana/web3.js 实现链上数据查询与交易签名
前端·javascript
梯度不陡5 小时前
Signal #17:Agent 开始进入组织系统
前端·javascript
胡萝卜术6 小时前
从暴力到Z字形消元:力扣240「搜索二维矩阵II」的降维打击之路
前端·javascript·面试
云浪6 小时前
前端二进制数组完全指南:ArrayBuffer、TypedArray、DataView 一次讲透
前端·javascript
铁皮饭盒7 小时前
26年bunjs, elysia+pg一把梭, redis都省了
前端·javascript·后端
kyriewen20 小时前
别再对着 TypeScript 报错发呆了:我把 10 个最常见的红色波浪线翻译成了人话
前端·javascript·typescript
free3521 小时前
从 0 实现一个 Tiny JavaScript VM:项目架构拆解
javascript