[improvement] directive naming-style in jsx (#2677)

This commit is contained in:
neverland 2019-02-02 17:35:32 +08:00 committed by GitHub
parent e3f4cac05d
commit 583f89f09d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 35 additions and 35 deletions

View File

@ -88,7 +88,7 @@ export default sfc({
return ( return (
<transition name="van-slide-up"> <transition name="van-slide-up">
<div v-show={this.value} class={bem({ withtitle: title })}> <div vShow={this.value} class={bem({ withtitle: title })}>
{title ? Header() : this.actions.map(Option)} {title ? Header() : this.actions.map(Option)}
{Footer} {Footer}
</div> </div>

View File

@ -224,7 +224,7 @@ export default sfc({
return ( return (
<div class={bem()}> <div class={bem()}>
<Field <Field
v-model={data.name} vModel={data.name}
clearable clearable
label={t('name')} label={t('name')}
placeholder={t('namePlaceholder')} placeholder={t('namePlaceholder')}
@ -232,7 +232,7 @@ export default sfc({
onFocus={onFocus('name')} onFocus={onFocus('name')}
/> />
<Field <Field
v-model={data.tel} vModel={data.tel}
clearable clearable
type="tel" type="tel"
label={t('tel')} label={t('tel')}
@ -241,7 +241,7 @@ export default sfc({
onFocus={onFocus('tel')} onFocus={onFocus('tel')}
/> />
<Field <Field
v-show={this.showArea} vShow={this.showArea}
readonly readonly
label={t('area')} label={t('area')}
placeholder={t('areaPlaceholder')} placeholder={t('areaPlaceholder')}
@ -251,7 +251,7 @@ export default sfc({
}} }}
/> />
<Detail <Detail
v-show={this.showDetail} vShow={this.showDetail}
focused={this.detailFocused} focused={this.detailFocused}
value={data.addressDetail} value={data.addressDetail}
error={errorInfo.addressDetail} error={errorInfo.addressDetail}
@ -269,8 +269,8 @@ export default sfc({
/> />
{this.showPostal && ( {this.showPostal && (
<Field <Field
v-show={!hideBottomFields} vShow={!hideBottomFields}
v-model={data.postalCode} vModel={data.postalCode}
type="tel" type="tel"
maxlength="6" maxlength="6"
label={t('postal')} label={t('postal')}
@ -282,15 +282,15 @@ export default sfc({
{this.$slots.default} {this.$slots.default}
{this.showSetDefault && ( {this.showSetDefault && (
<SwitchCell <SwitchCell
v-model={data.isDefault} vModel={data.isDefault}
v-show={!hideBottomFields} vShow={!hideBottomFields}
title={t('defaultAddress')} title={t('defaultAddress')}
onChange={event => { onChange={event => {
this.$emit('change-default', event); this.$emit('change-default', event);
}} }}
/> />
)} )}
<div v-show={!hideBottomFields} class={bem('buttons')}> <div vShow={!hideBottomFields} class={bem('buttons')}>
<Button <Button
block block
loading={this.isSaving} loading={this.isSaving}
@ -308,7 +308,7 @@ export default sfc({
)} )}
</div> </div>
<Popup <Popup
v-model={this.showAreaPopup} vModel={this.showAreaPopup}
position="bottom" position="bottom"
lazyRender={false} lazyRender={false}
getContainer="body" getContainer="body"

View File

@ -25,7 +25,7 @@ export default sfc({
return ( return (
<Cell <Cell
class={bem({ disabled, unswitchable: !switchable })} class={bem({ disabled, unswitchable: !switchable })}
is-link={!disabled && switchable} isLink={!disabled && switchable}
onClick={this.onSelect} onClick={this.onSelect}
> >
<Radio name={data.id}> <Radio name={data.id}>

View File

@ -34,7 +34,7 @@ export default sfc({
<a href={this.thumbLink} class={bem('thumb')}> <a href={this.thumbLink} class={bem('thumb')}>
{slots.thumb || {slots.thumb ||
(this.lazyLoad ? ( (this.lazyLoad ? (
<img class={bem('img')} v-lazy={thumb} /> <img class={bem('img')} vLazy={thumb} />
) : ( ) : (
<img class={bem('img')} src={thumb} /> <img class={bem('img')} src={thumb} />
))} ))}

View File

@ -123,7 +123,7 @@ export default sfc({
const Content = this.inited && ( const Content = this.inited && (
<div <div
v-show={this.show} vShow={this.show}
ref="wrapper" ref="wrapper"
class={bem('wrapper')} class={bem('wrapper')}
onTransitionend={this.onTransitionEnd} onTransitionend={this.onTransitionEnd}

View File

@ -95,7 +95,7 @@ export default sfc({
return ( return (
<div class={bem()}> <div class={bem()}>
<Field <Field
v-model={data.name} vModel={data.name}
clearable clearable
maxlength="30" maxlength="30"
label={t('name')} label={t('name')}
@ -104,7 +104,7 @@ export default sfc({
onFocus={onFocus('name')} onFocus={onFocus('name')}
/> />
<Field <Field
v-model={data.tel} vModel={data.tel}
clearable clearable
type="tel" type="tel"
label={t('tel')} label={t('tel')}

View File

@ -52,8 +52,8 @@ export default sfc({
title={this.title || t('title')} title={this.title || t('title')}
value={this.value} value={this.value}
border={this.border} border={this.border}
is-link={this.editable} isLink={this.editable}
value-class={this.valueClass} valueClass={this.valueClass}
onClick={() => { onClick={() => {
this.$emit('click'); this.$emit('click');
}} }}

View File

@ -103,7 +103,7 @@ export default sfc({
onClickExchangeButton() { onClickExchangeButton() {
this.$emit('exchange', this.currentCode); this.$emit('exchange', this.currentCode);
// auto clear currentCode when not use v-model // auto clear currentCode when not use vModel
if (!this.code) { if (!this.code) {
this.currentCode = ''; this.currentCode = '';
} }
@ -129,7 +129,7 @@ export default sfc({
render(h) { render(h) {
const ExchangeBar = this.showExchangeBar && ( const ExchangeBar = this.showExchangeBar && (
<Field <Field
v-model={this.currentCode} vModel={this.currentCode}
clearable clearable
border={false} border={false}
class={bem('field')} class={bem('field')}
@ -190,12 +190,12 @@ export default sfc({
return ( return (
<div class={bem()}> <div class={bem()}>
{ExchangeBar} {ExchangeBar}
<Tabs v-model={this.tab} class={bem('tab')} line-width={120}> <Tabs vModel={this.tab} class={bem('tab')} line-width={120}>
{CouponTab} {CouponTab}
{DisabledCouponTab} {DisabledCouponTab}
</Tabs> </Tabs>
<Button <Button
v-show={this.showCloseButton} vShow={this.showCloseButton}
size="large" size="large"
class={bem('close')} class={bem('close')}
text={this.closeButtonText || t('close')} text={this.closeButtonText || t('close')}

View File

@ -89,7 +89,7 @@ export default sfc({
const ButtonGroup = ( const ButtonGroup = (
<div class={['van-hairline--top', bem('footer', { buttons: hasButtons })]}> <div class={['van-hairline--top', bem('footer', { buttons: hasButtons })]}>
<Button <Button
v-show={this.showCancelButton} vShow={this.showCancelButton}
size="large" size="large"
class={bem('cancel')} class={bem('cancel')}
loading={this.loading.cancel} loading={this.loading.cancel}
@ -99,7 +99,7 @@ export default sfc({
}} }}
/> />
<Button <Button
v-show={this.showConfirmButton} vShow={this.showConfirmButton}
size="large" size="large"
class={[bem('confirm'), { 'van-hairline--left': hasButtons }]} class={[bem('confirm'), { 'van-hairline--left': hasButtons }]}
loading={this.loading.confirm} loading={this.loading.confirm}
@ -113,7 +113,7 @@ export default sfc({
return ( return (
<transition name="van-dialog-bounce"> <transition name="van-dialog-bounce">
<div v-show={this.value} class={[bem(), this.className]}> <div vShow={this.value} class={[bem(), this.className]}>
{Title} {Title}
{Content} {Content}
{ButtonGroup} {ButtonGroup}

View File

@ -219,9 +219,9 @@ export default sfc({
<Swipe <Swipe
ref="swipe" ref="swipe"
loop={this.loop} loop={this.loop}
indicator-color="white" indicatorColor="white"
initial-swipe={this.startPosition} initialSwipe={this.startPosition}
show-indicators={this.showIndicators} showIndicators={this.showIndicators}
onChange={this.onChange} onChange={this.onChange}
> >
{images.map((image, index) => { {images.map((image, index) => {
@ -237,7 +237,7 @@ export default sfc({
}; };
return ( return (
<SwipeItem> <SwipeItem>
{this.lazyLoad ? <img v-lazy={image} {...props} /> : <img src={image} {...props} />} {this.lazyLoad ? <img vLazy={image} {...props} /> : <img src={image} {...props} />}
</SwipeItem> </SwipeItem>
); );
})} })}

View File

@ -90,7 +90,7 @@ export default sfc({
return ( return (
<div <div
v-show={this.showNoticeBar} vShow={this.showNoticeBar}
class={bem({ withicon: mode })} class={bem({ withicon: mode })}
style={barStyle} style={barStyle}
onClick={() => { onClick={() => {

View File

@ -34,7 +34,7 @@ export default sfc({
}; };
return ( return (
<transition name="van-slide-down"> <transition name="van-slide-down">
<div v-show={this.value} class={bem()} style={style}> <div vShow={this.value} class={bem()} style={style}>
{this.message} {this.message}
</div> </div>
</transition> </transition>

View File

@ -138,7 +138,7 @@ export default sfc({
return ( return (
<transition name={this.transition ? 'van-slide-up' : ''}> <transition name={this.transition ? 'van-slide-up' : ''}>
<div <div
v-show={this.show} vShow={this.show}
style={{ zIndex: this.zIndex }} style={{ zIndex: this.zIndex }}
class={bem([theme])} class={bem([theme])}
onTouchstart={stop} onTouchstart={stop}

View File

@ -19,7 +19,7 @@ export default sfc({
return ( return (
<transition name="van-fade"> <transition name="van-fade">
<div <div
v-show={this.visible} vShow={this.visible}
style={style} style={style}
class={[bem(), this.className]} class={[bem(), this.className]}
onTouchmove={event => { onTouchmove={event => {

View File

@ -59,7 +59,7 @@ export default sfc({
render(h) { render(h) {
const slots = this.$slots; const slots = this.$slots;
return ( return (
<div v-show={this.selected || this.parent.animated} class={bem('pane')}> <div vShow={this.selected || this.parent.animated} class={bem('pane')}>
{this.inited ? slots.default : h()} {this.inited ? slots.default : h()}
{slots.title && <div ref="title">{slots.title}</div>} {slots.title && <div ref="title">{slots.title}</div>}
</div> </div>

View File

@ -89,7 +89,7 @@ export default sfc({
return ( return (
<transition name="van-fade"> <transition name="van-fade">
<div v-show={this.value} class={bem([style, this.position])}> <div vShow={this.value} class={bem([style, this.position])}>
{Content()} {Content()}
</div> </div>
</transition> </transition>