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

setValue not work #54

Closed
liangxp opened this issue Mar 21, 2019 · 7 comments
Closed

setValue not work #54

liangxp opened this issue Mar 21, 2019 · 7 comments

Comments

@liangxp
Copy link

liangxp commented Mar 21, 2019

$f.setValue(field,value) $f.setValue({ field1:value1, field2:value2, field3:value3 });
调用setValue后,通过$f.formData获取到值已经发生改变,但是控件view内容并未发生改变,请问是什么原因呢

@xaboy
Copy link
Owner

xaboy commented Mar 21, 2019

form-create 和 ui的版本是多少?

@liangxp
Copy link
Author

liangxp commented Mar 21, 2019

@xaboy

"form-create": "^1.6.1",
"iview": "^3.0.0",
"vue": "^2.5.16",

@xaboy
Copy link
Owner

xaboy commented Mar 21, 2019

可以发下生成规则吗或者说一下那个组件value 修改后view内容没有发生改变

@liangxp
Copy link
Author

liangxp commented Mar 21, 2019

@xaboy 在演示地址http://jsrun.net/NQhKp/edit 中,演示代码mounted方法替换为如下代码:
mounted: function() { $f = this.$refs.fc.$f; this.$refs.fc.$f.setValue({"goods_name":"fdsfdsfd"}) //动态添加表单元素 //$f.append($r, 'pic'); }

@xaboy
Copy link
Owner

xaboy commented Mar 21, 2019

不好意思,这个是演示的代码版本有点老了,写的有点问题.我刚刚更新了下已经好了

@liangxp
Copy link
Author

liangxp commented Mar 21, 2019

我本地需要更新下么?我本地意思一样的情况

@xaboy
Copy link
Owner

xaboy commented Mar 21, 2019

你可以参考一下我刚刚新的代码 http://jsrun.net/NQhKp/edit

@xaboy xaboy closed this as completed Apr 12, 2019
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