vscode怎么自定義代碼模版?下面本篇文章給大家介紹一下vscode快速創建vue文件模版的方法。有一定的參考價值,有需要的朋友可以參考一下,希望對大家有所幫助。
相關推薦:《vscode基礎教程》
修改位置
打開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!!
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END