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

observers 监听多个值时报错 #1782

Open
ff77645 opened this issue Dec 25, 2024 · 0 comments
Open

observers 监听多个值时报错 #1782

ff77645 opened this issue Dec 25, 2024 · 0 comments

Comments

@ff77645
Copy link

ff77645 commented Dec 25, 2024

当observers 监听多个值,且其中包含 properties 中的值时报错.

报错内容:

TypeError: Cannot read property '@@iterator' of undefined
    at _iterableToArray (iterableToArray.js:5)
    at _toConsumableArray (toConsumableArray.js:6)
    at ComponentCaller.handler (mergeOptions.js:175)
    at _callWithErrorHandling (errorHandling.js:7)
    at job (watch.js:115)
    at _watch (watch.js:143)
    at MpxProxy.watch (proxy.js:382)
    at proxy.js:344
    at Array.forEach (<anonymous>)
    at MpxProxy.initWatch (proxy.js:341)(env: Windows,mp,1.06.2409140; lib: 3.6.6)

代码复现:

createComponent({
  properties: {
    size: {
      type: String,
      value: ''
    }
  },
  data: { count: 1 },
  observers: {
    // 监听多个值,且其中包含 properties 的值
    'size,count'(val, old) {
      console.log('')
    }
  }
})
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

1 participant