-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
多层map下,dom没有重新渲染 #1842
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
你这里有两个问题:
|
@yuche 谢谢解答,是由于你说的第一个的问题。这种情况是应该设计成一个state,改成你的写法已经解决~ |
循环中编译有一套复杂的处理机制,某些情况取是可以的,但更推荐的做法是把数据从 this.state 中取出来再用。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
[问题描述:站在其它人的角度尽可能清晰地、简洁地把问题描述清楚]
复现步骤
[复现问题的步骤]
[或者可以直接贴源代码,能贴文字就不要截图]
期望行为

预期{this.state[item.value] === vItem.value ? '0' : '1'} 这里的代码会根据点击当前View而更新。
报错信息
dom没有变化,如下图,从console可以看出,state已经变化了,render函数也执行了,但是dom没有根据表达式更新。
[这里请贴上你的完整报错截图或文字]
系统信息
Taro CLI 1.2.2 environment info:
System:
OS: macOS 10.14.2
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.11.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
npmPackages:
@tarojs/async-await: ^1.2.4 => 1.2.4
@tarojs/components: ^1.2.2 => 1.2.2
@tarojs/plugin-babel: ^1.2.2 => 1.2.2
@tarojs/plugin-csso: ^1.2.2 => 1.2.2
@tarojs/plugin-less: ^1.2.2 => 1.2.2
@tarojs/plugin-sass: ^1.2.4 => 1.2.4
@tarojs/plugin-uglifyjs: ^1.2.2 => 1.2.2
@tarojs/redux: ^1.2.2 => 1.2.2
@tarojs/redux-h5: ^1.2.2 => 1.2.2
@tarojs/router: ^1.2.2 => 1.2.2
@tarojs/taro: ^1.2.2 => 1.2.2
@tarojs/taro-alipay: ^1.2.2 => 1.2.2
@tarojs/taro-h5: ^1.2.2 => 1.2.2
@tarojs/taro-swan: ^1.2.2 => 1.2.2
@tarojs/taro-weapp: ^1.2.2 => 1.2.2
@tarojs/webpack-runner: ^1.2.2 => 1.2.2
eslint-config-taro: ^1.2.2 => 1.2.2
eslint-plugin-taro: ^1.2.2 => 1.2.2
补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]
单层map循环,没问题,两层map循环并且this.state[item.value] === vItem.value 这种写法有问题。dom没有变化
The text was updated successfully, but these errors were encountered: