• VSCode 使用 Vue2.0 通用结构模板


    安装vscode

    官网:https://code.visualstudio.com/

    安装 Vetur 插件,识别 vue 文件

    应用商店中搜索 Vetur,点击安装,安装完成之后点击重新加载

    新建代码片段

    文件 ➡ 首选项 ➡ 用户代码片段 ➡ 点击新建全局代码片段 ➡ 取名 vue ➡ 确定

    粘入自定义 .vue 模板,代码如下

    {
        "Print to console": {
            "prefix": "vue",
            "body": [
                "",
                "",
                "",
                "",
                ""
            ],
            "description": "生成vue模板"
        },
        "http-get请求": {
    	"prefix": "httpget",
    	"body": [
    		"this.\\$http({",
    		"url: this.\\$http.adornUrl(''),",
    		"method: 'get',",
    		"params: this.\\$http.adornParams({})",
    		"}).then(({ data }) => {",
    		"})"
    	],
    	"description": "httpGET请求"
        },
        "http-post请求": {
    	"prefix": "httppost",
    	"body": [
    		"this.\\$http({",
    		"url: this.\\$http.adornUrl(''),",
    		"method: 'post',",
    		"data: this.\\$http.adornData(data, false)",
    		"}).then(({ data }) => { });" 
    	],
    	"description": "httpPOST请求"
        }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
  • 相关阅读:
    Log4j additivity属性简介说明
    【C++】map、set,multiset和multimap的使用及底层原理【完整版】
    rabbitMQ的生产与消费由Kettle实现
    【操作系统】维持进程间互斥和同步的工具——PV操作
    DSP、DMP、CDP、CRM
    Nuttx学习笔记(一)
    GD32F303固件库开发(14)----IIC之配置OLED
    Elasticsearch(macbook搭建,Elasticsearch+kibana)一步到位
    【消息队列】消息队列常见面试题总结
    多种格式图片可用的二维码生成技巧,快来学习一下
  • 原文地址:https://blog.csdn.net/weixin_45987569/article/details/133462668