Files
dvcp_v2_wxcp_app/components/AiOpenData/AiOpenData.vue

32 lines
547 B
Vue
Raw Normal View History

2021-11-24 16:34:31 +08:00
<template>
2022-07-21 17:55:28 +08:00
<ww-open-data class="AiOpenData" :type="type" :openid="oid"/>
2021-11-24 16:34:31 +08:00
</template>
<script>
import {mapActions} from "vuex";
export default {
name: "AiOpenData",
props: ['type', 'openid'],
2021-12-03 15:18:13 +08:00
computed: {
oid() {
/**
* 后端返回格式(cropId|userId)
*/
return this.openid?.split("|")?.[1] || this.openid || ""
}
},
2021-11-24 16:34:31 +08:00
methods: {
2022-07-21 11:19:08 +08:00
...mapActions(['initOpenData']),
2021-11-24 16:34:31 +08:00
},
2021-12-15 14:12:56 +08:00
watch: {
2022-07-21 11:19:08 +08:00
openid: {
handler(v) {
v && this.initOpenData()
},
immediate: true
2021-12-15 14:12:56 +08:00
}
2021-11-24 16:34:31 +08:00
}
}
</script>