mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 02:16:12 +08:00
types(ContactCard): use tsx (#8112)
This commit is contained in:
parent
865f72bd5b
commit
c9abb07a7a
@ -1,8 +1,11 @@
|
|||||||
|
import { PropType } from 'vue';
|
||||||
import { createNamespace } from '../utils';
|
import { createNamespace } from '../utils';
|
||||||
import Cell from '../cell';
|
import Cell from '../cell';
|
||||||
|
|
||||||
const [createComponent, bem, t] = createNamespace('contact-card');
|
const [createComponent, bem, t] = createNamespace('contact-card');
|
||||||
|
|
||||||
|
export type ContactCardType = 'add' | 'edit';
|
||||||
|
|
||||||
export default createComponent({
|
export default createComponent({
|
||||||
props: {
|
props: {
|
||||||
tel: String,
|
tel: String,
|
||||||
@ -13,7 +16,7 @@ export default createComponent({
|
|||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String as PropType<ContactCardType>,
|
||||||
default: 'add',
|
default: 'add',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -21,7 +24,7 @@ export default createComponent({
|
|||||||
emits: ['click'],
|
emits: ['click'],
|
||||||
|
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const onClick = (event) => {
|
const onClick = (event: MouseEvent) => {
|
||||||
if (props.editable) {
|
if (props.editable) {
|
||||||
emit('click', event);
|
emit('click', event);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user