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:代码提示时候显示的描述

  • 相关阅读:
    call apply bind的区别
    Js的继承方法
    JS回调函数 回调地狱问题 以及解决方法
    Js闭包
    Js中的this指向问题
    ES6 Class继承
    面向对象
    Vue
    JavaScript数组 字符串的方法
    28.mysql练习
  • 原文地址:https://www.cnblogs.com/ximensama/p/15049922.html
Copyright © 2011-2022 走看看