我正面临着semantic-ui-vue
下拉的问题。
这是我的沙盒链接:https://codesandbox.io/s/3qknm52pm5。
在我的沙盒中,我有两个下拉菜单:From
和To
。
From
显示正确的值,To
不会因密钥不匹配而导致。
我的App.vue
包含这个脚本
<script>
export default {
data() {
return {
from: [],
to: [],
fromCollection: [
{
value: "[email protected]",
text: "[email protected]"
},
{
value: "[email protected]",
text: "[email protected]"
},
{
value: "[email protected]",
text: "[email protected]"
},
{
value: "[email protected]",
text: "[email protected]"
}
],
toCollection: [
{
email: "[email protected]"
},
{
email: "[email protected]"
},
{
email: "[email protected]"
},
{
email: "[email protected]"
}
]
};
}
};
</script>
我用它们的组件是
<sui-dropdown
fluid
multiple
:options="fromCollection"
placeholder="from"
selection
v-model="from"
search
:allowAdditions="true"
text="email"
/>
<sui-dropdown
fluid
multiple
:options="toCollection"
placeholder="from"
selection
v-model="to"
search
:allowAdditions="true"
text="email"
/>
第一个下拉列表显示正确的值,因为我已经从fromCollection
传递了数据,而第二个下拉列表没有显示任何文本,因为我已经从toCollection
传递了具有不同键名的数据。
有人可以帮我用像toCollection
这样的动态密钥传递数据吗?
我在documentation找不到任何相关内容。有人可以帮忙吗?