chore: update jsx event binding to ts 4.4 (#9660)

This commit is contained in:
neverland 2021-10-12 09:49:09 +08:00 committed by GitHub
parent f30185e642
commit 81cb078396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 19 additions and 16 deletions

View File

@ -148,8 +148,8 @@ export default defineComponent({
<Popup
class={bem()}
position="bottom"
onUpdate:show={updateShow}
{...pick(props, popupKeys)}
{...{ 'onUpdate:show': updateShow }}
>
{renderHeader()}
{renderDescription()}

View File

@ -96,7 +96,7 @@ export default defineComponent({
errorMessage={props.errorMessage}
onBlur={onBlur}
onFocus={onFocus}
{...{ 'onUpdate:modelValue': onInput }}
onUpdate:modelValue={onInput}
/>
{renderSearchResult()}
</>

View File

@ -566,7 +566,7 @@ export default defineComponent({
teleport={props.teleport}
closeOnPopstate={props.closeOnPopstate}
closeOnClickOverlay={props.closeOnClickOverlay}
{...{ 'onUpdate:show': updateShow }}
onUpdate:show={updateShow}
>
{renderCalendar()}
</Popup>

View File

@ -228,8 +228,8 @@ export default defineComponent({
class={[bem([theme]), className]}
style={{ width: addUnit(width) }}
aria-labelledby={title || message}
onUpdate:show={updateShow}
{...pick(props, popupKeys)}
{...{ 'onUpdate:show': updateShow }}
>
{renderTitle()}
{renderContent()}

View File

@ -10,7 +10,7 @@ function initInstance() {
const Wrapper = {
setup() {
const { state, toggle } = usePopupState();
return () => <VanDialog {...state} {...{ 'onUpdate:show': toggle }} />;
return () => <VanDialog {...state} onUpdate:show={toggle} />;
},
};

View File

@ -206,13 +206,13 @@ export default defineComponent({
class={[bem(), props.className]}
overlayClass={bem('overlay')}
onClosed={onClosed}
onUpdate:show={updateShow}
{...pick(props, [
'show',
'transition',
'overlayStyle',
'closeOnPopstate',
])}
{...{ 'onUpdate:show': updateShow }}
>
{renderClose()}
{renderImages()}

View File

@ -40,10 +40,8 @@ function initInstance() {
return () => (
<VanImagePreview
{...state}
{...{
onClosed,
'onUpdate:show': toggle,
}}
onClosed={onClosed}
onUpdate:show={toggle}
/>
);
},

View File

@ -24,7 +24,11 @@ export default defineComponent({
lockScroll: Boolean,
}),
setup(props, { slots }) {
emits: ['update:show'],
setup(props, { emit, slots }) {
const updateShow = (show: boolean) => emit('update:show', show);
return () => (
<Popup
show={props.show}
@ -37,6 +41,7 @@ export default defineComponent({
position="top"
duration={0.2}
lockScroll={props.lockScroll}
onUpdate:show={updateShow}
>
{slots.default ? slots.default() : props.message}
</Popup>

View File

@ -20,7 +20,7 @@ function initInstance() {
({ instance } = mountComponent({
setup() {
const { state, toggle } = usePopupState();
return () => <VanNotify {...state} {...{ 'onUpdate:show': toggle }} />;
return () => <VanNotify {...state} onUpdate:show={toggle} />;
},
}));
}

View File

@ -223,9 +223,9 @@ export default defineComponent({
transition="van-popover-zoom"
lockScroll={false}
onTouchstart={onTouchstart}
onUpdate:show={updateShow}
{...attrs}
{...pick(props, popupProps)}
{...{ 'onUpdate:show': updateShow }}
>
{props.showArrow && <div class={bem('arrow')} />}
<div role="menu" class={bem('content')}>

View File

@ -105,8 +105,8 @@ export default defineComponent({
class={bem('field')}
border={false}
onKeypress={onKeypress}
onUpdate:modelValue={onInput}
{...fieldAttrs}
{...{ 'onUpdate:modelValue': onInput }}
/>
);
};

View File

@ -140,8 +140,8 @@ export default defineComponent({
<Popup
class={bem()}
position="bottom"
onUpdate:show={updateShow}
{...pick(props, popupKeys)}
{...{ 'onUpdate:show': updateShow }}
>
{renderHeader()}
{renderRows()}

View File

@ -141,7 +141,7 @@ export default defineComponent({
closeOnClickOverlay={props.closeOnClickOverlay}
onClick={onClick}
onClosed={clearTimer}
{...{ 'onUpdate:show': updateShow }}
onUpdate:show={updateShow}
>
{renderIcon()}
{renderMessage()}