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

}
相关推荐
牧羊狼的狼19 小时前
React 中的 HOC 和 Hooks
前端·javascript·react.js·hooks·高阶组件·hoc
知识分享小能手20 小时前
React学习教程,从入门到精通, React 属性(Props)语法知识点与案例详解(14)
前端·javascript·vue.js·学习·react.js·vue·react
luckys.one20 小时前
第9篇:Freqtrade量化交易之config.json 基础入门与初始化
javascript·数据库·python·mysql·算法·json·区块链
mCell21 小时前
JavaScript 的多线程能力:Worker
前端·javascript·浏览器
weixin_437830941 天前
使用冰狐智能辅助实现图形列表自动点击:OCR与HID技术详解
开发语言·javascript·ocr
gnip1 天前
JavaScript事件流
前端·javascript
小菜全1 天前
基于若依框架Vue+TS导出PDF文件的方法
javascript·vue.js·前端框架·json
wow_DG1 天前
【Vue2 ✨】Vue2 入门之旅 · 进阶篇(一):响应式原理
前端·javascript·vue.js
weixin_456904271 天前
UserManagement.vue和Profile.vue详细解释
前端·javascript·vue.js
秋秋小事1 天前
React Hooks useContext
前端·javascript·react.js