2018-03-19 10:16:27 +08:00
|
|
|
|
2017-11-09 15:58:53 +08:00
|
|
|
export default {
|
2018-04-08 21:17:20 +08:00
|
|
|
name: 'ACheckableTag',
|
2017-11-09 15:58:53 +08:00
|
|
|
model: {
|
|
|
|
prop: 'checked',
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
prefixCls: {
|
|
|
|
default: 'ant-tag',
|
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
checked: Boolean,
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
classes () {
|
|
|
|
const { prefixCls, checked } = this
|
|
|
|
return {
|
|
|
|
[`${prefixCls}`]: true,
|
|
|
|
[`${prefixCls}-checkable`]: true,
|
|
|
|
[`${prefixCls}-checkable-checked`]: checked,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
handleClick () {
|
|
|
|
const { checked } = this
|
|
|
|
this.$emit('input', !checked)
|
|
|
|
this.$emit('change', !checked)
|
|
|
|
},
|
|
|
|
},
|
2018-03-19 09:43:31 +08:00
|
|
|
render () {
|
|
|
|
const { classes, handleClick, $slots } = this
|
|
|
|
return (
|
|
|
|
<div class={classes} onClick={handleClick}>
|
|
|
|
{$slots.default}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
},
|
2017-11-09 15:58:53 +08:00
|
|
|
}
|
2018-03-19 10:16:27 +08:00
|
|
|
|