element icon indicating copy to clipboard operation
element copied to clipboard

[select] 设置默认值不会自动选中

Open masterzhang opened this issue 10 years ago • 4 comments

ElementUI version

1.0.2

OS/Browers version

win10/Chrome 53

Vue version

2.0.8

Reproduction Link

http://runjs.cn/code/3rwcco53

Steps to reproduce

我设置了value,但是在载入的时候,不会自动选中

masterzhang avatar Nov 22 '16 13:11 masterzhang

Demo 地址错了吧,麻烦重新贴一下。

Leopoldthecoder avatar Nov 22 '16 13:11 Leopoldthecoder

@Leopoldthecoder

http://runjs.cn/detail/3rwcco53

第一次用忘记点发布了,不好意思

masterzhang avatar Nov 22 '16 13:11 masterzhang

你的 this.value 不应该赋值为某一个 option 对象,而应该是 el-option 的 value 属性对应的字段:

this.value = 'shanghai'

这样就对了。

Leopoldthecoder avatar Nov 22 '16 14:11 Leopoldthecoder

多选类型的时候 第一步 我是动态生成的数据 第二步 我想动态选中几个回填 可是 设置this.value =[****],是无法选中的?!

bigcui avatar Apr 25 '17 02:04 bigcui