mirror of
https://github.com/kihashi/stardew_community_checklist.git
synced 2025-10-19 08:03:17 +00:00
Add a button checkbox component
This commit is contained in:
parent
2fb087e02e
commit
5db60dd09b
36
src/components/ButtonCheckbox.vue
Normal file
36
src/components/ButtonCheckbox.vue
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<template>
|
||||||
|
<button class="button is-rounded"
|
||||||
|
:class="checked ? checked_class : unchecked_class"
|
||||||
|
v-on:click="click"
|
||||||
|
>
|
||||||
|
<slot></slot>
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'button-checkbox',
|
||||||
|
props: {
|
||||||
|
checked_class: {
|
||||||
|
default: 'is-info'
|
||||||
|
},
|
||||||
|
unchecked_class: {
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
checked: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
click () {
|
||||||
|
this.checked = !this.checked
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user