Fix error on switch
This commit is contained in:
parent
154ca365c5
commit
33998cf45f
|
@ -1,12 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="bg-grey-lightest rounded overflow-hidden">
|
<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')">
|
<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>
|
<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>
|
<span class="hidden">Grid</span>
|
||||||
</button>
|
</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>
|
<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>
|
<span class="hidden">List</span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -19,18 +19,5 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
mode: String,
|
mode: String,
|
||||||
},
|
},
|
||||||
|
|
||||||
// data() {
|
|
||||||
// return {
|
|
||||||
// mode: 'grid'
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
changeMode(mode) {
|
|
||||||
this.mode = mode
|
|
||||||
this.$emit('display-changed', mode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Reference in a new issue