Here is my problem:
(这是我的问题:)
- I have an
tags
array used to loop to create a list of checkboxes.(我有一个用于循环创建复选框列表的tags
数组。)
- I have a
selectTags
array to store selected tags.(我有一个selectTags
数组来存储选定的标签。)
Everytime a tag is check/uncheck, this array is updated.(每当标签被选中/取消选中时,此数组都会更新。)
- I have an
images
object that store image url and image tags, like this:(我有一个存储图像URL和图像标签的images
对象,如下所示:)
days : {
day1 : {
image1: {
url : '',
tags: ['tag1', 'tag2']
},
image2: {
url : '',
tags: ['tag1']
},
},
day2 : {
image1: {
url : '',
tags: ['tag3']
},
image2: {
url : '',
tags: ['tag1']
},
}
}
Inside my loop component, I do the follow to show images:
(在循环组件内部,执行以下操作以显示图像:)
<figure v-for="(image, index) in images" :key="index">
<img :src="image['url']" alt="">
</figure>
Now, I need to hide/show images based on what tags are selected
(现在,我需要根据选择的标签来隐藏/显示图像)
ask by marcelo2605 translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…