mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-09-03 22:59:44 +08:00
chore: update jsx event binding to ts 4.4 (#9660)
This commit is contained in:
parent
f30185e642
commit
81cb078396
@ -148,8 +148,8 @@ export default defineComponent({
|
|||||||
<Popup
|
<Popup
|
||||||
class={bem()}
|
class={bem()}
|
||||||
position="bottom"
|
position="bottom"
|
||||||
|
onUpdate:show={updateShow}
|
||||||
{...pick(props, popupKeys)}
|
{...pick(props, popupKeys)}
|
||||||
{...{ 'onUpdate:show': updateShow }}
|
|
||||||
>
|
>
|
||||||
{renderHeader()}
|
{renderHeader()}
|
||||||
{renderDescription()}
|
{renderDescription()}
|
||||||
|
@ -96,7 +96,7 @@ export default defineComponent({
|
|||||||
errorMessage={props.errorMessage}
|
errorMessage={props.errorMessage}
|
||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
onFocus={onFocus}
|
onFocus={onFocus}
|
||||||
{...{ 'onUpdate:modelValue': onInput }}
|
onUpdate:modelValue={onInput}
|
||||||
/>
|
/>
|
||||||
{renderSearchResult()}
|
{renderSearchResult()}
|
||||||
</>
|
</>
|
||||||
|
@ -566,7 +566,7 @@ export default defineComponent({
|
|||||||
teleport={props.teleport}
|
teleport={props.teleport}
|
||||||
closeOnPopstate={props.closeOnPopstate}
|
closeOnPopstate={props.closeOnPopstate}
|
||||||
closeOnClickOverlay={props.closeOnClickOverlay}
|
closeOnClickOverlay={props.closeOnClickOverlay}
|
||||||
{...{ 'onUpdate:show': updateShow }}
|
onUpdate:show={updateShow}
|
||||||
>
|
>
|
||||||
{renderCalendar()}
|
{renderCalendar()}
|
||||||
</Popup>
|
</Popup>
|
||||||
|
@ -228,8 +228,8 @@ export default defineComponent({
|
|||||||
class={[bem([theme]), className]}
|
class={[bem([theme]), className]}
|
||||||
style={{ width: addUnit(width) }}
|
style={{ width: addUnit(width) }}
|
||||||
aria-labelledby={title || message}
|
aria-labelledby={title || message}
|
||||||
|
onUpdate:show={updateShow}
|
||||||
{...pick(props, popupKeys)}
|
{...pick(props, popupKeys)}
|
||||||
{...{ 'onUpdate:show': updateShow }}
|
|
||||||
>
|
>
|
||||||
{renderTitle()}
|
{renderTitle()}
|
||||||
{renderContent()}
|
{renderContent()}
|
||||||
|
@ -10,7 +10,7 @@ function initInstance() {
|
|||||||
const Wrapper = {
|
const Wrapper = {
|
||||||
setup() {
|
setup() {
|
||||||
const { state, toggle } = usePopupState();
|
const { state, toggle } = usePopupState();
|
||||||
return () => <VanDialog {...state} {...{ 'onUpdate:show': toggle }} />;
|
return () => <VanDialog {...state} onUpdate:show={toggle} />;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -206,13 +206,13 @@ export default defineComponent({
|
|||||||
class={[bem(), props.className]}
|
class={[bem(), props.className]}
|
||||||
overlayClass={bem('overlay')}
|
overlayClass={bem('overlay')}
|
||||||
onClosed={onClosed}
|
onClosed={onClosed}
|
||||||
|
onUpdate:show={updateShow}
|
||||||
{...pick(props, [
|
{...pick(props, [
|
||||||
'show',
|
'show',
|
||||||
'transition',
|
'transition',
|
||||||
'overlayStyle',
|
'overlayStyle',
|
||||||
'closeOnPopstate',
|
'closeOnPopstate',
|
||||||
])}
|
])}
|
||||||
{...{ 'onUpdate:show': updateShow }}
|
|
||||||
>
|
>
|
||||||
{renderClose()}
|
{renderClose()}
|
||||||
{renderImages()}
|
{renderImages()}
|
||||||
|
@ -40,10 +40,8 @@ function initInstance() {
|
|||||||
return () => (
|
return () => (
|
||||||
<VanImagePreview
|
<VanImagePreview
|
||||||
{...state}
|
{...state}
|
||||||
{...{
|
onClosed={onClosed}
|
||||||
onClosed,
|
onUpdate:show={toggle}
|
||||||
'onUpdate:show': toggle,
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,11 @@ export default defineComponent({
|
|||||||
lockScroll: Boolean,
|
lockScroll: Boolean,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
setup(props, { slots }) {
|
emits: ['update:show'],
|
||||||
|
|
||||||
|
setup(props, { emit, slots }) {
|
||||||
|
const updateShow = (show: boolean) => emit('update:show', show);
|
||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
<Popup
|
<Popup
|
||||||
show={props.show}
|
show={props.show}
|
||||||
@ -37,6 +41,7 @@ export default defineComponent({
|
|||||||
position="top"
|
position="top"
|
||||||
duration={0.2}
|
duration={0.2}
|
||||||
lockScroll={props.lockScroll}
|
lockScroll={props.lockScroll}
|
||||||
|
onUpdate:show={updateShow}
|
||||||
>
|
>
|
||||||
{slots.default ? slots.default() : props.message}
|
{slots.default ? slots.default() : props.message}
|
||||||
</Popup>
|
</Popup>
|
||||||
|
@ -20,7 +20,7 @@ function initInstance() {
|
|||||||
({ instance } = mountComponent({
|
({ instance } = mountComponent({
|
||||||
setup() {
|
setup() {
|
||||||
const { state, toggle } = usePopupState();
|
const { state, toggle } = usePopupState();
|
||||||
return () => <VanNotify {...state} {...{ 'onUpdate:show': toggle }} />;
|
return () => <VanNotify {...state} onUpdate:show={toggle} />;
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -223,9 +223,9 @@ export default defineComponent({
|
|||||||
transition="van-popover-zoom"
|
transition="van-popover-zoom"
|
||||||
lockScroll={false}
|
lockScroll={false}
|
||||||
onTouchstart={onTouchstart}
|
onTouchstart={onTouchstart}
|
||||||
|
onUpdate:show={updateShow}
|
||||||
{...attrs}
|
{...attrs}
|
||||||
{...pick(props, popupProps)}
|
{...pick(props, popupProps)}
|
||||||
{...{ 'onUpdate:show': updateShow }}
|
|
||||||
>
|
>
|
||||||
{props.showArrow && <div class={bem('arrow')} />}
|
{props.showArrow && <div class={bem('arrow')} />}
|
||||||
<div role="menu" class={bem('content')}>
|
<div role="menu" class={bem('content')}>
|
||||||
|
@ -105,8 +105,8 @@ export default defineComponent({
|
|||||||
class={bem('field')}
|
class={bem('field')}
|
||||||
border={false}
|
border={false}
|
||||||
onKeypress={onKeypress}
|
onKeypress={onKeypress}
|
||||||
|
onUpdate:modelValue={onInput}
|
||||||
{...fieldAttrs}
|
{...fieldAttrs}
|
||||||
{...{ 'onUpdate:modelValue': onInput }}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -140,8 +140,8 @@ export default defineComponent({
|
|||||||
<Popup
|
<Popup
|
||||||
class={bem()}
|
class={bem()}
|
||||||
position="bottom"
|
position="bottom"
|
||||||
|
onUpdate:show={updateShow}
|
||||||
{...pick(props, popupKeys)}
|
{...pick(props, popupKeys)}
|
||||||
{...{ 'onUpdate:show': updateShow }}
|
|
||||||
>
|
>
|
||||||
{renderHeader()}
|
{renderHeader()}
|
||||||
{renderRows()}
|
{renderRows()}
|
||||||
|
@ -141,7 +141,7 @@ export default defineComponent({
|
|||||||
closeOnClickOverlay={props.closeOnClickOverlay}
|
closeOnClickOverlay={props.closeOnClickOverlay}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
onClosed={clearTimer}
|
onClosed={clearTimer}
|
||||||
{...{ 'onUpdate:show': updateShow }}
|
onUpdate:show={updateShow}
|
||||||
>
|
>
|
||||||
{renderIcon()}
|
{renderIcon()}
|
||||||
{renderMessage()}
|
{renderMessage()}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user