vscode 快捷输入-自定义代码块

2022-02-23  本文已影响0人  wyc0859

vscode左下角


image.png
自定义vue代码

输入vue,找到vue.json


image.png

如改为

    "v3-html": {
        "prefix": "v3",
        "body": [
            "<template>",
            " <div class=\"$1\"></div>", 
            "</template>",
            " ",
            "<script setup>", 
            " ",
            "</script>",
            " ",
            "<style lang=\"sass\" scoped>", 
            "</style>"
        ],
        "description": "v3-hteml-content"
    }

这样在vue文件,内容顶部输入v3就会自动出现自定义代码

vue的script部分实现自定义

同样,找到javascript.json


image.png
"Print to console": {
        "prefix": "clog",
        "body": [
            "console.log('$1');",
            "$2"
        ],
        "description": "Log output to console"
    }
上一篇 下一篇

猜你喜欢

热点阅读