• 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
  • 相关阅读:
    web3之跨链预言机SupraOracles:什么是Supra
    kotlin coroutine源码解析之Job启动流程
    UDP攻击是什么?
    BFD基础
    川宁生物抢抓机遇,力争成为合成生物制造领域的头部企业
    【LeetCode】621.任务调度器
    基于ssm的社区医院儿童预防接种管理系统设计与实现-计算机毕业设计源码+LW文档
    课程思政案例----简道云零代码应用开发实训平台
    Linux 学习笔记:input 子系统
    JDBC、ORM、JPA与Spring Data JPA
  • 原文地址:https://blog.csdn.net/weixin_42388872/article/details/133802960