Vue3公众号跳转到小程序

目录 | 微信开放文档

请先阅读上面的文档

 <wx-open-launch-weapp
                    v-if="detail.visitTypeId === 6 && getVisitStatus() === '进入诊室'"
                    class="launch-btn"
                    username="gh_bf31b19754d2"
                    :path="getPath()"
                >
                    <div v-is="'script'" type="text/wxtag-template" style="display: block">
                        <div v-is="'style'">.enter-room { width: 320px; height: 240px; opacity: 0}</div>
                        <div class="enter-room">进入诊室</div>
                    </div>
                </wx-open-launch-weapp>

 // 微信小程序跳转链接
        const getPath = () => {
//传入必要的值
            const sdktoken = Cookie.get('sdktoken');
            const userId = Cookie.get('uid');
            const token = localStorage.getItem('token');
            const url = `${window.location.protocol}//${window.location.host}${commonUtils.getPathContext()}`;
            return `pages/consultation-detail/consultation-detail?imAccount=${userId}&imToken=${sdktoken}&requestUrl=${url}&token=${token}&visitId=${props.detail.visitXID}`;
        };

v-is是干啥的?

渲染指定名称的DOM节点,你可以写你自定义的组件名称达成复用组件

猜你喜欢

转载自blog.csdn.net/aZHANGJIANZHENa/article/details/124386731
今日推荐