调整自动引入
This commit is contained in:
31
components/AiOpenData/AiOpenData.vue
Normal file
31
components/AiOpenData/AiOpenData.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user