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方法
网友回复
什么是WebRCD技术?
如何在centos的服务器docker上安装运行微信qq?
如何用ai图片模型祛除图片油腻感?
google的gemini-omni多模态大模型在哪可以免费体验?
google的Antigravity 、Antigravity CLI、Antigravity IDE、Antigravity SDK有啥区别不同?
Pyaudio如何录制windows扬声器输出的声音?
为啥win10电脑上sounddevice与pyaudio无法播放声音?
半导体摩尔定律与韬(τ)定律区别?
千问qwen有没有实时同声翻译的ai大模型?
国内大厂怎么都没有文本描述生成音效声音的api?


