feat: add emits option
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<demo-section>
|
||||
<demo-block :title="t('basicUsage')">
|
||||
<van-cell-group>
|
||||
<van-cell :title="t('cell')" :value="t('content')" />
|
||||
<van-cell :title="t('cell')" :value="t('content')" @click="onClick" />
|
||||
<van-cell :title="t('cell')" :value="t('content')" :label="t('desc')" />
|
||||
</van-cell-group>
|
||||
</demo-block>
|
||||
@@ -108,6 +108,12 @@ export default {
|
||||
verticalCenter: 'Vertical center',
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
onClick() {
|
||||
console.log('click');
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ export default createComponent({
|
||||
...routeProps,
|
||||
},
|
||||
|
||||
emits: ['click'],
|
||||
|
||||
setup(props, { slots, emit }) {
|
||||
return function () {
|
||||
const { icon, size, title, label, value, isLink } = props;
|
||||
|
||||
Reference in New Issue
Block a user