avoid using obj as key

This commit is contained in:
les 2020-06-02 21:42:11 +02:00
parent bb2b012ead
commit c953fbf319
2 changed files with 10 additions and 2 deletions

View file

@ -23,7 +23,7 @@
el-button.mr-1.bg-dark(type='text' round plain v-for='t in filters.tags' size='mini'
:key='t' @click='removeTag(t)') {{t}}
el-button.mr-1.bg-dark.text-warning(type='text' round plain v-for='p in selectedPlaces' size='mini'
:key='p' @click='removePlace(p.id)') {{p.name}}
:key='p.id' @click='removePlace(p.id)') {{p.name}}
</template>
<script>

View file

@ -52,7 +52,7 @@
client-only
#picker.mx-auto
v-date-picker.mb-2.mt-3(
:mode='event.type === "multidate" ? "range" : "single"'
:mode='datePickerMode'
:attributes='attributes'
v-model='date'
:locale='$i18n.locale'
@ -173,6 +173,14 @@ export default {
},
computed: {
...mapState(['tags', 'places', 'events', 'settings']),
datePickerMode () {
const modeMap = {
multidate: 'range',
normal: 'single',
recurrent: 'multiple'
}
return modeMap[this.event.type]
},
whenPatterns () {
const dates = this.date
if (!dates || !dates.length) { return '' }