Fix error on switch
This commit is contained in:
parent
154ca365c5
commit
33998cf45f
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="bg-grey-lightest rounded overflow-hidden">
|
||||
<button type="button" class="p-2 focus:outline-none" :class="[mode == 'grid' ? 'bg-blue-light text-white' : 'text-grey-darkest']" @click="changeMode('grid')">
|
||||
<svg class="h-5 w-5 fill-current"role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__grid"></use></svg>
|
||||
<button type="button" class="p-2 focus:outline-none" :class="[mode == 'grid' ? 'bg-blue-light text-white' : 'text-grey-darkest']" @click="$emit('display-changed', 'grid')">
|
||||
<svg class="h-5 w-5 fill-current" role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__grid"></use></svg>
|
||||
<span class="hidden">Grid</span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="p-2 focus:outline-none" :class="[mode == 'list' ? 'bg-blue-light text-white' : 'text-grey-darkest']" @click="changeMode('list')">
|
||||
<button type="button" class="p-2 focus:outline-none" :class="[mode == 'list' ? 'bg-blue-light text-white' : 'text-grey-darkest']" @click="$emit('display-changed', 'list')">
|
||||
<svg class="h-5 w-5 fill-current" role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__list"></use></svg>
|
||||
<span class="hidden">List</span>
|
||||
</button>
|
||||
|
@ -19,18 +19,5 @@ export default {
|
|||
props: {
|
||||
mode: String,
|
||||
},
|
||||
|
||||
// data() {
|
||||
// return {
|
||||
// mode: 'grid'
|
||||
// }
|
||||
// },
|
||||
|
||||
methods: {
|
||||
changeMode(mode) {
|
||||
this.mode = mode
|
||||
this.$emit('display-changed', mode)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Reference in a new issue