//父组件
<view class="hex" @click="hexiaosub">保存主页核销码</view>
<hwxtPopup ref="hwxt" ></hwxtPopup>
import hwxtPopup from "../../../subPage/components/hwxtPopup/advertPopup.vue"
components: {
hwxtPopup,
},
methods: {
//保存核销码
hexiaosub() {
console.log(1);
this.$refs.hwxt.onshow()
this.close()
},
}
//子组件
<view class="coneent" v-if="hwxt">
<view @click="onshow"></view>
<view class="uni_pop_xl">
<view class="uni_pop_nl">
<view>微信扫一扫核销</view>
</view>
<view>
<image src="../../../static/der.jpg" style="width: 280rpx;height: 280rpx;"></image>
<view>久</view>
</view>
</view>
<view class="immediately" @click="open">保存</view>
</view>
</template>
<script>
export default {
// name: "advertPopup",
data() {
return {
hwxt:false,
}
},
methods: {
onshow(){
this.hwxt=true
},
open() {
this.hwxt = false;
// this.$emit('userData', this.isVisible);
},
}
}
vue父组件调用子组件方法
最新推荐文章于 2025-03-25 16:55:27 发布