- 安裝一個插件,識別vue文件
2.新建代碼片段
文件–>首選項–>用戶代碼片段–>點擊新建代碼片段–取名vue.json 確定
3.粘貼入自己寫的.vue模板
{
"Print to console": {
"prefix": "vue",
"body": [
"<!-- $1 -->",
"<template>",
"<div class='$2'>$5</div>",
"</template>",
"",
"<script>",
"",
"export default {",
"components: {},",
"data() {",
"return {",
"",
"}",
"},",
"computed: {},",
"watch: {},",
"methods: {",
"",
"},",
"created() {",
"",
"},",
"mounted() {",
"",
"},",
"}",
"</script>",
"<style lang='scss' scoped>",
"$4",
"</style>"
],
"description": "Log output to console"
}
}
4.上面代碼中的 “prefix”: “vue”, 就是快捷鍵;保存好之後,新建.vue結尾的文件
輸入vue 按鍵盤的tab