chore: using string arguments on directives (#9659)

This commit is contained in:
neverland 2021-10-11 21:04:24 +08:00 committed by GitHub
parent 2008982ff9
commit f30185e642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 11 deletions

View File

@ -402,7 +402,7 @@ export default defineComponent({
)} )}
</div> </div>
<Popup <Popup
v-model={[state.showAreaPopup, 'show']} v-model:show={state.showAreaPopup}
round round
teleport="body" teleport="body"
position="bottom" position="bottom"

View File

@ -280,7 +280,7 @@ export default defineComponent({
const renderTabs = () => ( const renderTabs = () => (
<Tabs <Tabs
v-model={[state.activeTab, 'active']} v-model:active={state.activeTab}
animated animated
class={bem('tabs')} class={bem('tabs')}
color={props.activeColor} color={props.activeColor}

View File

@ -200,7 +200,7 @@ export default defineComponent({
return () => ( return () => (
<div class={bem()}> <div class={bem()}>
{renderExchangeBar()} {renderExchangeBar()}
<Tabs v-model={[state.tab, 'active']} class={bem('tab')} border={false}> <Tabs v-model:active={state.tab} class={bem('tab')} border={false}>
{renderCouponTab()} {renderCouponTab()}
{renderDisabledTab()} {renderDisabledTab()}
</Tabs> </Tabs>

View File

@ -174,7 +174,7 @@ export default defineComponent({
onClick={onClickWrapper} onClick={onClickWrapper}
> >
<Popup <Popup
v-model={[state.showPopup, 'show']} v-model:show={state.showPopup}
class={bem('content')} class={bem('content')}
overlay={overlay} overlay={overlay}
position={direction === 'down' ? 'top' : 'bottom'} position={direction === 'down' ? 'top' : 'bottom'}

View File

@ -7,7 +7,7 @@ test('should render correctly after inserting a tab', async () => {
const wrapper = mount({ const wrapper = mount({
render() { render() {
return ( return (
<Tabs v-model={[this.active, 'active']}> <Tabs v-model:active={this.active}>
<Tab title="1">1</Tab> <Tab title="1">1</Tab>
{this.insert && ( {this.insert && (
<div> <div>
@ -37,7 +37,7 @@ test('should render correctly after inserting a tab with name', async () => {
const wrapper = mount({ const wrapper = mount({
render() { render() {
return ( return (
<Tabs v-model={[this.active, 'active']} onChange={onChange}> <Tabs v-model:active={this.active} onChange={onChange}>
{this.insert && ( {this.insert && (
<Tab title="bar" name="bar"> <Tab title="bar" name="bar">
bar bar

View File

@ -371,9 +371,7 @@ export default defineComponent({
renderTitle={item.$slots.title} renderTitle={item.$slots.title}
activeColor={props.titleActiveColor} activeColor={props.titleActiveColor}
inactiveColor={props.titleInactiveColor} inactiveColor={props.titleInactiveColor}
onClick={(event: MouseEvent) => { onClick={(event: MouseEvent) => onClickTab(item, index, event)}
onClickTab(item, index, event);
}}
{...pick(item, [ {...pick(item, [
'dot', 'dot',
'badge', 'badge',

View File

@ -151,7 +151,7 @@ test('should allow to select multiple items when activeId is array', async () =>
render() { render() {
return ( return (
<TreeSelect <TreeSelect
v-model={[this.activeId, 'activeId']} v-model:activeId={this.activeId}
items={this.items} items={this.items}
mainActiveIndex={0} mainActiveIndex={0}
/> />
@ -185,7 +185,7 @@ test('should limit the selected item number when using max prop', async () => {
render() { render() {
return ( return (
<TreeSelect <TreeSelect
v-model={[this.activeId, 'activeId']} v-model:activeId={this.activeId}
max={1} max={1}
items={this.items} items={this.items}
mainActiveIndex={0} mainActiveIndex={0}