![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
TypeScript
Liberty_yes
一个很懒的程序猿小姐姐...^·^
展开
-
元素隐式具有 “any“ 类型,因为类型为 “string“ 的表达式不能用于索引类型
文件的过程中,我遍历了一个对象,然后取值的时候发现爆红,如下图👇。经过我一通排查(原因我对ts也不是很熟练),了解到大致意思是说。中则不是,因此要么转,要么声明,要么忽略…个人推荐方案二和方案三,方案一有点。的味道,意义不大,不推荐!中是默认给你转好的,而在。原创 2023-08-29 13:09:16 · 773 阅读 · 1 评论 -
Vue3使用v-model实现父子组件传值的两种方式
第一种方式:普通写法父组件:Father.vue<template> <h1>父组件</h1> <el-button @click="showDialog">点击展示弹框</el-button> <Dialog v-model:dialogVisible="dialogVisible" /></template><script>import { Dialog } from '@components原创 2022-05-08 06:45:00 · 4922 阅读 · 3 评论 -
vue3子组件修改传值给父组件报警告warn:Component emitted event “update:dialogAddVisible”
vue3报错之:使用v-model父子组件传值,子组件修改父组件里面的值的时候,报警告warn:Component emitted event “update:dialogAddVisible” but it is neither declared in the emits option nor as an “onUpdate:dialogAddVisible” prop父组件Father.vue:子组件Child.vue:报错:根据字面意思是说,一个[Vue警告]:组件触发事件"upda原创 2022-05-08 07:00:00 · 13200 阅读 · 1 评论 -
vue3使用defineProps报错‘defineProps‘ is not defined
使用 ``组合式 API 的语法糖的时候,defineProps报错:原创 2022-05-07 10:00:00 · 8965 阅读 · 3 评论 -
vue3报错:File was processed with these loaders:
第一次做vue3的项目的时候,从网上找了一个现成的框架进行开发,刚开始开发使用element-plus的时候,我直接把ui代码粘贴进我的项目中,发现代码报错,错误如下:Compiled with problems:ERROR in ./src/views/layoutpages/system/Menus.vue?vue&type=template&id=07e451a3&ts=true (./node_modules/vue-loader/dist/templateLoader.原创 2022-05-07 07:15:00 · 10877 阅读 · 6 评论 -
TypeScript中引入window身上的方法报错:找不到名称
TypeScript使用window身上的方法TypeScript中引入window身上的方法报错:类型“Window & typeof globalThis”上不存在属性“xxxx”。给window定义any类型:(不推荐)这样就可以正常使用并且不报错啦!在项目中找到*.d.ts后缀的文件 加上以下代码即可://.d.ts文件下interface Window { gdp: any; //注意这里如果不写any那么用window.gdp是可以的,但是用window.gdp原创 2022-02-25 07:30:00 · 5436 阅读 · 1 评论 -
TypeScript引入js第三方包,无法找到模块“xxx.js”的声明文件 xxx隐式拥有 “any“ 类型
TypeScript引入js第三方包,无法找到模块“xxx.js”的声明文件 xxx隐式拥有 "any" 类型原创 2022-02-23 12:35:10 · 28582 阅读 · 11 评论