Files
dvcp_v2_wxcp_app/components/AiOpenData/AiOpenData.vue
2024-10-31 16:22:41 +08:00

32 lines
547 B
Vue

<template>
<ww-open-data class="AiOpenData" :type="type" :openid="oid"/>
</template>
<script>
import {mapActions} from "vuex";
export default {
name: "AiOpenData",
props: ['type', 'openid'],
computed: {
oid() {
/**
* 后端返回格式(cropId|userId)
*/
return this.openid?.split("|")?.[1] || this.openid || ""
}
},
methods: {
...mapActions(['initOpenData']),
},
watch: {
openid: {
handler(v) {
v && this.initOpenData()
},
immediate: true
}
}
}
</script>