• vue3模板-vscode设置(语法糖)


    选择菜单里的 文件 > 首选项 > 用户代码片段
    vscode模板

    {
        "Print to conaole":{
            "prefix": "v-ts",    //在新建立的页面中输入C++就会有智能提示,Tab就自动生成好了
            "body": [
                "", //标准命名空间
                "",
                ""
            ],
            "description": "vue3 template."   //用户输入后智能提示的内容(你可以用中文写“生成C++模板”)
        }
    }
    
    • 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

    结果

    
    
    
    
    • 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

    useCurrentInstance.ts

    import { ComponentInternalInstance, getCurrentInstance } from 'vue'
    // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
    export default function useCurrentInstance() {
        const { appContext } = getCurrentInstance() as ComponentInternalInstance
        const proxy = appContext.config.globalProperties
        return {
            proxy
        }
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
  • 相关阅读:
    Scala函数作为参数传递的理解
    【Pytorch】深度学习之数据读取
    PyG 使用过程中出现的一些小bug。GAE 的negative_sampling中
    linux日常免交互汇总
    Jmeter进阶使用指南-使用参数化
    React_react入门
    React源码分析1-jsx转换及React.createElement
    爬虫的三大库
    PyQt5写一个Python代码执行器
    linux应用之文件读取
  • 原文地址:https://blog.csdn.net/weixin_42388872/article/details/133802960