请问vue多级嵌套组件中v-bind=“$attrs“和v-on=“$listeners“有什么用?
网友回复
假设componentA调用componentB,而componentB又调用componentC
我们先看看componentA的代码,直接调用componentB,并给componentB传了值name age和 adress。
<componentB :name="_name" :age="_age" :address="_address" :phone="_phone" @playBall="_playBall" @study="_study" >而componentB只接受了name和age的传值,componentB 代码如下:
<template>
<div></div>
<componentC />
</template>
<script>
export default {
indeterminate: true,
props: {
name,
age
}
另外ComponentB又调用了ComponentC, 若想在ComponentC获取ComponentA传输过来的没被ComponentB接收的非props数据,则组件ComponentB可以这么写:
<template> <div></div> <componentC v-bind="$attrs" v-on="$li...
点击查看剩余70%
如何让ai帮我自动在小红书或抖音上自动根据需求截流与潜在客户聊天拉客?
如果用go编写一个在virtualbox中启动的简单操作系统?
go如何搭建一个零信任网络?
如何用python实现一个公网代理访问软件?
如何用go实现一个公网代理访问软件?
如何用python实现一个内网穿透打洞程序,实现内网的80端口暴露到公网上可以访问?
如何用go实现一个内网穿透打洞程序,实现内网的80端口暴露到公网上可以访问?
何为Shadowsocks 代理?
python如何实现类似php的opendir目录相互隔离的fastcgi多租户虚拟空间?
nodejs如何实现类似php的opendir目录相互隔离的fastcgi多租户虚拟空间?


