1.在父组件中引入子组件
<template>
<view>
<pop ref="pop" @regodate="regodate"></pop>
//ref 调用时用于标识使用 ; @regodate ,调用子组件方法携带参数使用
</view>
</template>
<script>
//引入子组件
import pop from '@/components/pop-up/pop.vue'
export default {
components: {
customSwiper,
tabbar,
pop
},
}
</script>
2.调用子组件的数据和方法
var message = this.$refs.pop.isPopDate = 7 //把子组件中的isPopDate的值改为7
this.$refs.pop.test()//调用子组件method中的test方法
网友回复
有没有免费的api查询域名是否完成icp工信部备案?
codex用HyperFrames与 Remotion自动做视频那个更好?
claude code中Skill MCP CLI SubAgent Hooks Plugin区别?
浏览器webrtc点对点通讯如何才能走系统代理?
ai如何模拟人类与大自然迭代升级生存的游戏?
DepthAnything如何结合threejs将视频通过3d深度转成3d视频画面?
TurbinePHP与swoole有啥不同?
dns中a记录与cname记录区别?
AI 编程里 SDD、TDD、BDD是哈有啥区别?
Cloudflared tunnel如何实现泛域名解析?


