扫码关注官方订阅号
父组件变量传给子组件,子组件修改后回传给父组件,无法修改
{{item.name}}
子组件中setCurrent正常执行,父组件onCurrent却没有反应,而且父组件的current变量未发生变化;
有哪位大大帮看看什么情况
闭关修行中......
在你代码中没有看到你使用到onCurrent这个方法
onCurrent
<p id="app"> <navbar :list="nav" :current="current" @on-current="onCurrent"></navbar> </p>
在navbar上添加 @on-current="onCurrent"
this.$on('on-current', function (msg) { console.log(msg)})
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
在你代码中没有看到你使用到
onCurrent这个方法在navbar上添加 @on-current="onCurrent"
this.$on('on-current', function (msg) {
console.log(msg)
})