父组件
<template>
<view >
<coinPopup :popupShow="coinPopupShow" :coin_info="coinTypeInfo" @closeMixedCurrencyClick="closeMixedCurrencyClick"></coinPopup>
</view>
</template>
<script>
import wybSlideListener from '@/components/wyb-slide-listener/wyb-slide-listener.vue'
import coinPopup from "./popup.vue"
export default {
components:{
summaryTable,mixCoinTable,coinPopup
},
data() {
return {
coinTypeInfo:{},
coinPopupShow:false,
}
},
methods: {
addMixedCurrencyClick:function(show){
this.coinPopupShow=true;
console.log(this.coinPopupShow);
},
closeMixedCurrencyClick:function(show){
this.coinPopupShow=false;
console.log(this.coinPopupShow);
},
getcoinPopup:function(){
return this.coinPopupShow;
}
}
}
</script>
<style scoped lang="scss">
</style>
子组件:
<template>
<u-popup
v-model="popupShow"
width="90%"
close-icon-size="40"
:custom-style="customStyle"
mode="center"
:mask-custom-style="maskCustomStyle"
:closeable="true"
@close="closePopup()"
>
<view style="width: 90%;margin: 5%;">
<h3>{{getTitle()}}</h3>
</view>
</u-popup>
</template>
<script>
export default {
props:{
coin_info:{
type: Object,
default () {
return {};
}
},
item:{},
popupShow:{
type: Boolean,
default: false
},
},
data() {
return {
maskCustomStyle:{
background: 'rgba(0, 0, 0, 0.1)'
},
customStyle:{
}
}
},
computed: {
},
onShow() {
},
created() {
},
methods: {
getTitle(){
if(this.coin_info.coin_type === 'all'){
return this.item.quantity+this.coin_info.coin;
}else{
return this.coin_info.coin_name+this.coin_info.coin;
}
},
closePopup(){
this.$emit('closeMixedCurrencyClick',{coinPopup:false});
}
}
}
</script>
<style>
</style>