[英]How to pass the data with dynamic key in semantic UI vue dropdown?
I am facing an issue with semantic-ui-vue
dropdown. 我面临semantic-ui-vue
下拉菜单的问题。
Here is my sandbox link: https://codesandbox.io/s/3qknm52pm5 . 这是我的沙盒链接: https : //codesandbox.io/s/3qknm52pm5 。
In my sandbox, I have two dropdowns: From
and To
. 在我的沙箱中,我有两个下拉菜单: From
和To
。
From
shows the correct values and To
doesn't due to key mismatch. From
显示正确的值,而To
则不是由于密钥不匹配而导致的。
My App.vue
contain this script 我的App.vue
包含此脚本
<script>
export default {
data() {
return {
from: [],
to: [],
fromCollection: [
{
value: "abc@gmail.com",
text: "abc@gmail.com"
},
{
value: "def@gmail.com",
text: "def@gmail.com"
},
{
value: "qwerty@gmail.com",
text: "qwerty@gmail.com"
},
{
value: "shubham@gmail.com",
text: "shubham@gmail.com"
}
],
toCollection: [
{
email: "abc@gmail.com"
},
{
email: "def@gmail.com"
},
{
email: "qwerty@gmail.com"
},
{
email: "shubham@gmail.com"
}
]
};
}
};
</script>
and the component I used for both of them are 而我用于两者的组件是
<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"
/>
The 1st dropdown shows the correct values because I have passed the data from fromCollection
whereas the 2nd dropdown doesn't show any text because I have passed the data from toCollection
which has different key names. 第一个下拉列表显示正确的值,因为我已经从fromCollection
传递了数据,而第二个下拉列表却没有显示任何文本,因为我从toCollection
传递了具有不同键名的数据。
Can someone help me to pass the data with dynamic keys like toCollection
? 有人可以帮助我使用诸如toCollection
类的动态键传递数据吗?
I couldn't find anything related in the documentation . 我在文档中找不到任何相关内容 。 Can someone help? 有人可以帮忙吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.