v-for in listview or select

https://vuejs.org/
Post Reply
rl539b8
Posts: 1
Joined: Fri Jun 15, 2018 12:38 am
Status: Offline

v-for in listview or select

Post by rl539b8 » Fri Jun 15, 2018 11:57 am

I found problem with using v-for in child nodes of tags <select data-role="select"> or <ul data-role="listview">:

<select data-role="select">
<option v-for="item in items">{{ item.name }}</option>
</select>
<== in this case list is not updating while changing array items

<ul data-role="listview">
<li v-for="item in items">{{ item.name }}</li>
</ul>
<== in this case list is updating but added item looks different than others

Metro UI v4.2.8.684

full example:


User avatar
olton
Site Admin
Posts: 133
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Fri Jun 15, 2018 9:09 pm

To change select options at runtime you must use method data() of select component https://metroui.org.ua/forms.html#_select

Post Reply