allinfo.vue
1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<template>
<div>
<!-- 根据 type 的值决定显示哪个组件 -->
<capitalpoolinfo ref="capitalpoolinforef" v-if="type == '1'" @changecouponid="changecouponid"/>
<couponinfo ref="couponinforef" v-else-if="type == '2'" @changecouponid="changecouponid"/>
</div>
</template>
<script>
import capitalpoolinfo from './capitalpoolinfo.vue';
import couponinfo from './couponinfo.vue';
export default {
components: {
capitalpoolinfo,
couponinfo
},
props: {
type: {
type: String,
required: '1'
},
},
data() {
return {
id: '',
info: {}
}
},
methods: {
int(e,info) {
if(this.type === '1'){
this.$refs.capitalpoolinforef.int(e)
}else{
this.info = info
this.$refs.couponinforef.int(e,info)
}
},
chanetype(e) {
this.type = e
},
changecouponid(e) {
console.error(e)
let c1 = {
type:'2',
id:e.id,
info:e
}
this.$emit('changetypeinfo',c1)
},
changecapitalpoolid(e) {
},
},
};
</script>
<style scoped>
/* 添加样式 */
</style>