<template>
<div class="main">
<img src="../../../static/img/wxmember.png" alt="">
<button @click="showBuy">立即购买</button>
<div class="buy" v-if="isBuy" @click="closeBuy">
<img src="../../../static/img/buyyear.png" alt="" @click="sureBuy($event)">
</div>
</div>
</template>
data () {
return {
isBuy:false,
}
},
methods: {
// 方法
showBuy(){
this.isBuy = true;
},
closeBuy(){
this.isBuy = false;
},
sureBuy(event){
event.cancelBubble = true;
}
},