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

使用vant dialog 传递 beforeClose 无效 #8938

Open
LengYXin opened this issue Mar 17, 2021 · 2 comments
Open

使用vant dialog 传递 beforeClose 无效 #8938

LengYXin opened this issue Mar 17, 2021 · 2 comments
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@LengYXin
Copy link
Contributor

LengYXin commented Mar 17, 2021

相关平台

微信小程序

小程序基础库: 2.16.0
使用框架: React

复现步骤

<van-dialog
          useTitleSlot
          useSlot
          title="标题"
          show={this.state.show}
          cancelButtonText={data.cancelButtonText}
          cancelButtonColor="#999999"
          confirmButtonText={data.confirmButtonText}
          confirmButtonColor="#AD9174"
          showCancelButton
          beforeClose={this.beforeClose}
          onCancel={() => this.onParticipate(false)}
          onConfirm={this.onConfirm.bind(this)}
        />

当 传递 beforeClose 切值是一个函数的同时。这个 值在vant 的组件中就还是 null 如果不是 函数。则有效
image
使用ref查看组件传递 发现没有这个属性
image

期望结果

props 函数有效

实际结果

无效

环境信息

 Taro CLI 3.1.4 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node
      Yarn: 1.22.10 - ~/.nvm/versions/node/v12.18.3/bin/yarn
      npm: 7.5.6 - ~/.nvm/versions/node/v12.18.3/bin/npm

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Mar 17, 2021
@LengYXin
Copy link
Contributor Author

我想是taro重写的渲染机制把 函数 给过滤掉了或者当成了 事件?但是我不清楚这部分代码在哪里。所以不清楚了。只是我的假设

@smoothdvd
Copy link
Contributor

@LengYXin 找到解决办法了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants