乐贴网
  • 首页
  • 程序语言
  • VPS
  • SEO优化
  • 账号分享
  • 每日神器
  • 开源软件
  • 操作系统
  • 更多
    • 数据库
    • 框架
    • 移动开发
    • 人工智能
    • 区块链

vue3中$refs的类型为什么是unknown?有什么好处?

vue.js 4年前 16
+-
  1. 首页
  2. vue.js
  3. 正文

vue3中$refs的类型为什么是unknown?有什么好处?

$refs的类型默认为什么不写成HTMLElement或者实例或者undefined, 这样可以通过is来判断正确的类型(代码好看些), 但是现在这样要自己去断言吗?

在这里断言和any还有啥区别了呢?

Spring BootSpring CloudDockerSpringnode.jsangularreact-nativeavalondjangovue.jshadoop.net
思否

相关推荐

ESlint报错提示clear

ESlint报错提示clear

vue.js 4年前 3691
antdesign vue 的tree树如何自定义子节点的title

antdesign vue 的tree树如何自定义子节点的title

vue.js 4年前 2281
Cannot find module '**' or its corresponding type declarations.

Cannot find module '**' or its corresponding type declarations.

vue.js 4年前 968
如何修改 antd vue 的默认样式

如何修改 antd vue 的默认样式

vue.js 4年前 871
vue devtools 报错 vue-inspect-instance找不到?

vue devtools 报错 vue-inspect-instance找不到?

vue.js 4年前 802
scss 中不能通过:export 导出scss变量

scss 中不能通过:export 导出scss变量

vue.js 4年前 635
vue 中如何判断undefined类型?

vue 中如何判断undefined类型?

vue.js 4年前 594
vue create项目报错?if not defined npm_config_node_gyp

vue create项目报错?if not defined npm_config_node_gyp

vue.js 4年前 575
vite2+vue3+ts+vant3.0环境下 vant如何自定义主题?

vite2+vue3+ts+vant3.0环境下 vant如何自定义主题?

vue.js 4年前 547
vue3 + typescript 中,定义了一个全局变量,获取该值时却总报错

vue3 + typescript 中,定义了一个全局变量,获取该值时却总报错

vue.js 4年前 480
完美解决 element-ui input=password 在浏览器会自动填充密码的问题

完美解决 element-ui input=password 在浏览器会自动填充密码的问题

vue.js 4年前 467
echarts实现渐变矩形水球图

echarts实现渐变矩形水球图

vue.js 4年前 421

Copyright © 2012 乐贴网 - All rights reserved