vscode使用vue2.0与3.0快速生成代码片段

一、2.0JSON格式

{
	// 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"
	// }
	"Print to console": {
		"prefix": "vue",
		"body": [
			"<template>",
			"    <div class=\"$2\">$5</div>",
			"</template>",
			"",
			"<script>",
			"",
			"export default {",
      "    name:'',",
			"    components: {},",
			"    data() {",
			"        return {",
			"",
			"        };",
			"    },",
			"    computed: {},",
			"    watch: {},",
			"    methods: {},",
			"    created() {},",
			"    mounted() {},",
			"    beforeCreate() {},",
			"    beforeMount() {},",
			"    beforeUpdate() {},",
			"    updated() {},",
			"    beforeDestroy() {},",
			"    destroyed() {},",
			"    activated() {},",
			"    }",
			"</script>",
			"<style lang='scss' scoped>",
			"//@import url($3); 引入公共css类",
			"$4",
			"</style>"
		],
		"description": "Log output to console"
	}
}

二、3.0JSON格式

{
	// 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"
	// }
	"vue3": {
		"prefix": "vue3",
		"body": [
				"<template>",
				"    <div>\n",
				"    </div>",
				"</template>\n",
				"<script lang='ts'>",
			"import { defineComponent } from 'vue'",
			"export default defineComponent({",
			"    name: '',",
			"})",
			"</script>",
			"<style scoped lang='less'>\n",
			"</style>",
		],
		"description": "Log output to console"
	}	
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
EVE國服市場中心(中)——该站提供與eve-central一致的功能,用於收集和統計EVE國服市場數據;但由於EVE沒有開放市場部份的API,因此所有數據將由玩家自發上傳。(原作者:copyliu,来自:国服) ★EVE后勤部-计算服务中心(中)——该站目前提供发明成功率及成本计算,可在游戏内浏览器直接访问使用。(原作者:yixiandave,来自:国服) ★制造计算器 镜像站(中)——该网站用于制造行业相关计算,价格为国服市场中心API提供的吉他星系市场价格数据,数据库为Inferno 1.2。输入要计算的物品名称(如:灾难级),输入蓝图材料等级,点提交即可。(原作者:tenkanse,来自:国服) ★EVE舰长之家(中)——国服玩家制作的EVE帮助信息交流平台,可以使用EVE的内置浏览器直接登录,也可以在游戏外访问;其中还有星系名中英文查询互译、跃迁范围计算工具。(原作者:EVE舰长之家,来自:国服) ★EVE-ma专业矿队作业管理平台(中)——一个帮助成规模的矿队记录采矿运矿、人员分工、工资核发等信息的管理平台。(原作者:openwater,来自:国服) ★EVE拍卖行(中)——游戏外随时查询吉他价格,目前仅包括白板装备和基础矿物的数据,每2小时更新一次。(原作者:NIcholascy,来自:国服) ★爱神虫洞俱乐部(中)——可以查询虫洞星系,虫洞洞口,虫洞异常;计算冬眠者掉落物的总价值;可以发布求助信息,求助信息将会返回到星系查询结果中。(原作者:venus爱神,来自:国服) ★新伊甸地理 EVE MAP Online(中)——玩家制作的文字星图和旗舰跳跃查询网页,包括旗舰跳跃路线规划工具、旗舰一跳可达星系查询,功能比较完善。(原作者:rex,来自:国服) ★EVE-Offline(英)——EVE服务器状
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值