使用VSCode快速建立vue檔案模版的方法介紹

2020-12-29 21:00:15
VSCode怎麼自定義程式碼模版?下面本篇文章給大家介紹一下快速建立vue檔案模版的方法。有一定的參考價值,有需要的朋友可以參考一下,希望對大家有所幫助。

相關推薦:《》

修改位置

開啟vscode偏好設定-使用者片段,可以搜尋已有的檔名,或者新建一個json檔案。

建立自定義模版

{
"Print to console": {
"prefix": "ybase",
"body": [
"<template>",
"  <div>",
"    <!-- Page -->",
"  </div>",
"</template>",
"<script lang=\"ts\">",
"import { Vue, Component } from \"vue-property-decorator\";",
"",
"@Component({})",
"export default class NAME extends Vue {",
"  // component",
"}",
"</script>",
"<style lang=\"scss\">",
"// style",
"</style>",
""
],
"description": "YBASE"
}
}

使用方法

以上我建立的是快速建立vue檔案模版。
新建頁面後,通過設定的快捷指令「ybase」即可快速生成頁面程式碼。

更多程式設計相關知識,請存取:!!

以上就是使用VSCode快速建立vue檔案模版的方法介紹的詳細內容,更多請關注TW511.COM其它相關文章!