Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

button编译open-type="getUserExtendInfo"时有问题 #4838

Open
qiluogede opened this issue Apr 15, 2024 · 2 comments
Open

button编译open-type="getUserExtendInfo"时有问题 #4838

qiluogede opened this issue Apr 15, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@qiluogede
Copy link

示例代码
`

<button class="login-mask" open-type="getUserExtendInfo" shareUserId="xxx" @getuserextendinfo="getuserextendinfo">
<button class="login-mask" open-type="getPhoneNumber" @getphonenumber="getphonenumber">

<script setup> function getphonenumber(e){ console.log(e,'????') } function getuserextendinfo(e){ console.log(e,'????') } </script>`

bug描述:
下面open-type="getPhoneNumber"可以 使用上面的open-type="getUserExtendInfo"就不行了
然后看快手编辑器 两个类型按钮的写法不一样
hbuilderx的打包代码里也没有搜到对getUserExtendInfo的处理 只搜到了getPhoneNumber

@qiluogede
Copy link
Author

button编译open-type="getUserExtendInfo"问题 快手小程序平台

@wangjinxin613
Copy link
Contributor

感谢反馈,问题已确认,会再未来的版本中修复这个问题,可暂时通过替换文件的方式解决
如果是用hbuilderX开发,需要替换hbuilderx安装目录下的 /HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli-vite/node_modules/@dcloudio/uni-mp-kuaishou/dist/uni.compiler.js 文件
cli项目替换 node_modules/@dcloudio/uni-mp-kuaishou/dist/uni.compiler.js 文件
第112行 增加 || name === 'getuserextendinfo'

const transformOn = uniCliShared.createTransformOn(uniMpCompiler.transformOn, {
    match: (name, node, context) => {
        if (name === 'getphonenumber' || name === 'getuserextendinfo')
            return true;
        if (name === 'input' && (node.tag === 'input' || node.tag === 'textarea')) {
            return true;
        }
        return uniCliShared.matchTransformOn(name, node, context);
    },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants