zoukankan      html  css  js  c++  java
  • vscode设置代码片段 vue代码模板

    vscode设置代码片段 vue代码模板

    • 文件 -> 首选项 -> 用户片段

    • 选择新代码片段

    • 在文件底下添加自己的代码模板
    "Create vue template": {
    		"prefix": "vue3router",
    		"body": [
    			"import { createRouter, createWebHashHistory } from 'vue-router';",
    			"",
    			"const router = createRouter({",
    			"    history: createWebHashHistory(),",
    			"    routes: [",
    			"        { path: '/', component: () => import('../views/home.vue')}",
    			"    ]",
    			"})",
    			"",
    			"export default router"
    		],
    		"description": "Create vue3router template"
    	}
    

    • 解释
    1. prefix:输入xxx,就可以提示出这段代码模板

    1. body:代码内容,每一行都要用双引号括起来,注意结尾要在外面加逗号,空行也要用双引号

    2. description:代码提示时候显示的描述

  • 相关阅读:
    1489 蜥蜴和地下室
    1521 一维战舰
    1596 搬货物
    1873 初中的算术
    CF-799B
    101 pick me up~
    落叶归根
    P1149 火柴棒等式
    P1540 机器翻译
    图论学习十之Sparse table
  • 原文地址:https://www.cnblogs.com/ximensama/p/15049922.html
Copyright © 2011-2022 走看看