具體步驟如下
1斤寇、選擇“文件 -> 首選項(xiàng) -> 用戶代碼片段”鬼廓,此時(shí)碎税,會彈出一個搜索框杯道,輸入vue
選擇
vue后萎庭,編輯器會自動打開一個名字為
vue.json的文件
2肴敛、復(fù)制以下內(nèi)容到這個文件中:
](javascript:void(0); "復(fù)制代碼")
<pre style="margin: 0px; padding: 0px; white-space: pre-wrap; overflow-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;">{
// 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:
// 2 for tab stops,
{1:label},
1');",
// "0",
"",
" </div>",
"</template>\n",
"<script type="text/javascript">",
"export default {",
" name: "",",
"",
" mixins: [],",
"",
" components: {},",
"",
" props: {},",
"",
" data() {",
" return {\n",
" }",
" },",
"",
" computed: {},",
"",
" watch: {},",
"",
" created() {},",
"",
" mounted() {},",
"",
" destroyed() {},",
"",
" methods: {},",
"}",
"</script>\n",
"<style lang="less" scoped>",
"",
"</style>",
"$2"
],
"description": "Log output to console"
}
}</pre>
](javascript:void(0); "復(fù)制代碼")
$0
表示生成代碼后光標(biāo)的位置 ;
``prefix表示生成對應(yīng)預(yù)設(shè)代碼的命令(此處設(shè)置的vue)
保存關(guān)閉文件;
3笙什、新建.vue文件,輸入vue,按回車愁憔,頁面結(jié)構(gòu)自動生成