[英]ionic 6 ion-checkbox is not checked
Vuejs 3, Ionic 6 Vuejs 3,离子 6
My code我的代码
<ion-list>
<ion-item v-for="(city, index) in cityDataList" :key="index">
<ion-label>{{ city.name }}</ion-label>
<ion-checkbox slot="end"
@update:modelValue="city.isActive = $event"
:modelValue="city.isActive" :checked="city.isActive"
@ionChange="this.selectCity(city.id)" />
</ion-item>
</ion-list>
The Api returns a list of cities. Api 返回城市列表。 Each has an isActive property.
每个都有一个 isActive 属性。 If the city has isActive true, then I expect to see a mark.
如果城市有 isActive 为真,那么我希望看到一个标记。 But this is not happening.
但这并没有发生。
link to documentation https://ionicframework.com/docs/api/checkbox#properties链接到文档https://ionicframework.com/docs/api/checkbox#properties
Here is a visual screenshot.这是一个视觉截图。
OMG,这是因为路由器视图有一个键
<router-view :key="$route.fullPath"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.