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

form-item自定义组件在didMount中调用this.emit发送值无法绑定 #688

Closed
4 tasks
smao999 opened this issue Apr 18, 2023 · 1 comment
Closed
4 tasks

Comments

@smao999
Copy link

smao999 commented Apr 18, 2023

组件

form-item

基础库版本

  • 1.x

设备机型

手机系统

  • iOS
  • Android
  • HarmonyOS

APP

组件库版本

预期行为

复现步骤

  1. form-item自定义组件绑定的值为name="value"
  2. 在自组件组件的didMount里面调用this.emit('onChange', value),无法更改form-item里面绑定value变量

复现 demo

@jc9702507
Copy link
Collaborator

jc9702507 commented Apr 18, 2023

组件didMount了但是外层页面还没有,this.emit就修改不了外层页面。

Options:

  1. 在didMount里setTimeout this.emit
  2. 不使用didMout,修改为pageEvents
pageEvents: {
    onReady() {
      this.emit()
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants