mirror of
https://github.com/itorr/one-last-image.git
synced 2026-01-02 20:06:03 +08:00
21 lines
493 B
JavaScript
21 lines
493 B
JavaScript
Vue.component('ui-switch',{
|
|
template: `<span class="ui-switch-box"
|
|
:data-checked="value"
|
|
:data-disabled="disabled"
|
|
@click="_switch">
|
|
<a class="switch" :style="{color}">
|
|
<i class="slider"></i>
|
|
</a>
|
|
<span><slot></slot></span>
|
|
</span>`,
|
|
props:{
|
|
value: Boolean,
|
|
color: String,
|
|
disabled: Boolean,
|
|
},
|
|
methods:{
|
|
_switch(){
|
|
this.$emit('input',!this.value);
|
|
}
|
|
}
|
|
}) |