框架版本:
vue 3.0
taro 3.4.4
引入openaiwidget插件,跳转小程序内部无响应。点击事件没响应。
<template>
<container title="客服">
<div>
<chat
@queryCallback="getQueryCallback"
@openWebview="openWebview"
@openMiniProgram="openMiniProgram"
/>
</div>
</container>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import Taro from '@tarojs/taro';
import config from '@/setting';
export default defineComponent({
name: 'CustomService',
setup() {
const getQueryCallback = () => {};
const openWebview = () => {};
const openMiniProgram = (e) => {
console.log('点击无响应', e)
const { appid: appId } = config;
const { appid, pagepath } = e.detail;
// 如果有appid是当前小程序,跳转内部页面
if (appid === appId) {
Taro.navigateTo({
url: pagepath
});
return;
}
Taro.navigateToMiniProgram({
appId: appid,
path: pagepath,
envVersion: 'release',
extraData: {
foo: 'bar'
},
success: (res) => {
console.log('成功', res);
},
fail: (err) => {
console.log('失败', err);
}
});
};
return {
getQueryCallback,
openWebview,
openMiniProgram
};
}
});
</script>