This commit is contained in:
2024-01-03 14:08:49 +08:00
parent 75aa253a29
commit 53f2b242a4
26 changed files with 1357 additions and 271 deletions

View File

@@ -11,7 +11,7 @@
class="btn"
v-for="opt in options"
:key="opt"
@click="active = opt"
@click="clickBtn(opt)"
:class="active == opt ? 'btn-active' : ''">
{{ opt }}
</button>
@@ -22,15 +22,18 @@
export default {
name: 'SelectorBtnGroup',
components: {},
props: ['options'],
props: ['options', 'active'],
data() {
return {
active: this.options[0] || 'default'
// active: this.options[0] || 'default'
};
},
computed: {},
methods: {
clickBtn(opt) {
// this.active = opt
this.$emit('emitFun', opt)
}
},
};
</script>