Vue.js - UI Element - Breaking changes select dropdown and key-value
I am using the vue-js 2.4
latest version tooelement-ui 1.4.1
I have a dropdown menu to select from a list of options and each option is an object. Everything was fine before the last update, but now I am facing several issues with select
. Especially the label displayed does not match the actual option selected.
Breaking change:
Select when value is an object, key-value is required as its unique identification key, # 5897
Questions
I would like to know how to use the new one value-key
, I tried several things, but it doesn't seem to change the problem.
source to share
Unfortunately I can't figure out what the pull request is , but looking at the changes, it seems like you need to specify how the objects are identified.
Apparently you have to specify which property of the custom object will be used by setting the attribute valueKey
on the el-select
element. By default this is 'value'
, so if your custom object has a member value
and can be used as an identifier, then this should already work. For all other objects, you can set the attribute appropriately valueKey
.
source to share