[Improvement] follow eslint-plugin-vue strongly-recommended code style (#482)

This commit is contained in:
neverland 2017-12-26 10:34:38 +08:00 committed by GitHub
parent 6362f7b74b
commit 508cdfc0c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
105 changed files with 409 additions and 462 deletions

View File

@ -16,6 +16,10 @@ module.exports = {
plugins: ['vue'], plugins: ['vue'],
extends: [
'plugin:vue/strongly-recommended'
],
globals: { globals: {
expect: true, expect: true,
sinon: true, sinon: true,
@ -142,6 +146,17 @@ module.exports = {
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [2, 'always', { objectsInObjects: false }], 'object-curly-spacing': [2, 'always', { objectsInObjects: false }],
'array-bracket-spacing': [2, 'never'], 'array-bracket-spacing': [2, 'never'],
'vue/jsx-uses-vars': 2 'vue/jsx-uses-vars': 2,
'vue/require-v-for-key': 0,
"vue/require-default-prop": 0,
"vue/name-property-casing": 0,
"vue/no-unused-vars": 0,
'vue/max-attributes-per-line': [2, {
"singleline": 5,
"multiline": {
"max": 5,
"allowFirstLine": false
}
}]
} }
} }

View File

@ -7,7 +7,7 @@
<demo-block :title="$t('title2')"> <demo-block :title="$t('title2')">
<van-button @click="show2 = true">{{ $t('button2') }}</van-button> <van-button @click="show2 = true">{{ $t('button2') }}</van-button>
<van-actionsheet v-model="show2" :actions="actions" :cancelText="$t('cancel')" /> <van-actionsheet v-model="show2" :actions="actions" :cancel-text="$t('cancel')" />
</demo-block> </demo-block>
<demo-block :title="$t('title3')"> <demo-block :title="$t('title3')">

View File

@ -2,11 +2,11 @@
<demo-section> <demo-section>
<demo-block :title="$t('basicUsage')"> <demo-block :title="$t('basicUsage')">
<van-address-edit <van-address-edit
:areaList="areaList" :area-list="areaList"
:showPostal="true" :show-postal="true"
:showSetDefault="true" :show-set-default="true"
:showSearchResult="true" :show-search-result="true"
:searchResult="searchResult" :search-result="searchResult"
@save="onSave" @save="onSave"
@delete="onDelete" @delete="onDelete"
@change-detail="onChangeDetail" @change-detail="onChangeDetail"

View File

@ -67,7 +67,7 @@ export default {
data() { data() {
return { return {
chosenAddressId: '1' chosenAddressId: '1'
} };
}, },
methods: { methods: {

View File

@ -1,15 +1,15 @@
<template> <template>
<demo-section> <demo-section>
<demo-block :title="$t('basicUsage')"> <demo-block :title="$t('basicUsage')">
<van-area :areaList="$t('areaList')" /> <van-area :area-list="$t('areaList')" />
</demo-block> </demo-block>
<demo-block :title="$t('title2')"> <demo-block :title="$t('title2')">
<van-area :areaList="$t('areaList')" :value="value" /> <van-area :area-list="$t('areaList')" :value="value" />
</demo-block> </demo-block>
<demo-block :title="$t('title3')"> <demo-block :title="$t('title3')">
<van-area :areaList="$t('areaList')" :columnsNum="2" :title="$t('title')" /> <van-area :area-list="$t('areaList')" :columns-num="2" :title="$t('title')" />
</demo-block> </demo-block>
</demo-section> </demo-section>
</template> </template>

View File

@ -1,11 +1,11 @@
<template> <template>
<demo-section> <demo-section>
<demo-block :title="$t('basicUsage')"> <demo-block :title="$t('basicUsage')">
<van-badge-group :activeKey="activeKey"> <van-badge-group :active-key="activeKey">
<van-badge :title="$t('title')" @click="onClick"></van-badge> <van-badge :title="$t('title')" @click="onClick" />
<van-badge :title="$t('title')" @click="onClick" info="8"></van-badge> <van-badge :title="$t('title')" @click="onClick" info="8" />
<van-badge :title="$t('title')" @click="onClick" info="99"></van-badge> <van-badge :title="$t('title')" @click="onClick" info="99" />
<van-badge :title="$t('title')" @click="onClick" info="199"></van-badge> <van-badge :title="$t('title')" @click="onClick" info="199" />
</van-badge-group> </van-badge-group>
</demo-block> </demo-block>
</demo-section> </demo-section>

View File

@ -5,7 +5,7 @@
<van-button type="primary">{{ $t('primary') }}</van-button> <van-button type="primary">{{ $t('primary') }}</van-button>
<van-button type="danger">{{ $t('danger') }}</van-button> <van-button type="danger">{{ $t('danger') }}</van-button>
</demo-block> </demo-block>
<demo-block :title="$t('title2')"> <demo-block :title="$t('title2')">
<van-button size="large">{{ $t('large') }}</van-button> <van-button size="large">{{ $t('large') }}</van-button>
<van-button size="normal">{{ $t('normal') }}</van-button> <van-button size="normal">{{ $t('normal') }}</van-button>
@ -18,8 +18,8 @@
</demo-block> </demo-block>
<demo-block :title="$t('title3')"> <demo-block :title="$t('title3')">
<van-button loading></van-button> <van-button loading />
<van-button loading type="primary"></van-button> <van-button loading type="primary" />
</demo-block> </demo-block>
<demo-block :title="$t('title4')"> <demo-block :title="$t('title4')">
@ -29,14 +29,14 @@
</demo-block> </demo-block>
<demo-block :title="$t('title5')"> <demo-block :title="$t('title5')">
<van-button type="primary" bottomAction>{{ $t('button') }}</van-button> <van-button type="primary" bottom-action>{{ $t('button') }}</van-button>
<van-row> <van-row>
<van-col span="12"> <van-col span="12">
<van-button bottomAction>{{ $t('button') }}</van-button> <van-button bottom-action>{{ $t('button') }}</van-button>
</van-col> </van-col>
<van-col span="12"> <van-col span="12">
<van-button type="primary" bottomAction>{{ $t('button') }}</van-button> <van-button type="primary" bottom-action>{{ $t('button') }}</van-button>
</van-col> </van-col>
</van-row> </van-row>
</demo-block> </demo-block>
@ -75,10 +75,9 @@ export default {
mini: 'Mini' mini: 'Mini'
} }
} }
} };
</script> </script>
<style lang="postcss"> <style lang="postcss">
.demo-button { .demo-button {
.van-button { .van-button {
@ -103,4 +102,4 @@ export default {
padding-left: 0; padding-left: 0;
} }
} }
</style> </style>

View File

@ -8,7 +8,7 @@
price="2.00" price="2.00"
:thumb="imageURL" :thumb="imageURL"
/> />
</demo-block> </demo-block>
<demo-block :title="$t('advancedUsage')"> <demo-block :title="$t('advancedUsage')">
<van-card <van-card
@ -32,7 +32,7 @@ export default {
data() { data() {
return { return {
imageURL: '//img.yzcdn.cn/upload_files/2017/07/02/af5b9f44deaeb68000d7e4a711160c53.jpg' imageURL: '//img.yzcdn.cn/upload_files/2017/07/02/af5b9f44deaeb68000d7e4a711160c53.jpg'
} };
} }
} };
</script> </script>

View File

@ -6,7 +6,7 @@
<van-cell-swipe :right-width="65" :left-width="65"> <van-cell-swipe :right-width="65" :left-width="65">
<span slot="left">{{ $t('button1') }}</span> <span slot="left">{{ $t('button1') }}</span>
<van-cell-group> <van-cell-group>
<van-cell :title="$t('title')" :value="$t('content')"></van-cell> <van-cell :title="$t('title')" :value="$t('content')" />
</van-cell-group> </van-cell-group>
<span slot="right">{{ $t('button2') }}</span> <span slot="right">{{ $t('button2') }}</span>
</van-cell-swipe> </van-cell-swipe>
@ -16,7 +16,7 @@
<van-cell-swipe :right-width="65" :left-width="65" :on-close="onClose"> <van-cell-swipe :right-width="65" :left-width="65" :on-close="onClose">
<span slot="left">{{ $t('button1') }}</span> <span slot="left">{{ $t('button1') }}</span>
<van-cell-group> <van-cell-group>
<van-cell :title="$t('title')" :value="$t('content')"></van-cell> <van-cell :title="$t('title')" :value="$t('content')" />
</van-cell-group> </van-cell-group>
<span slot="right">{{ $t('button2') }}</span> <span slot="right">{{ $t('button2') }}</span>
</van-cell-swipe> </van-cell-swipe>
@ -82,7 +82,7 @@ export default {
line-height: 44px; line-height: 44px;
} }
.van-cell-swipe__left { .van-cell-swipe__left {
background-color: #FF4444; background-color: #FF4444;
} }
.van-cell-swipe__right { .van-cell-swipe__right {
background-color: #84c483; background-color: #84c483;

View File

@ -37,12 +37,12 @@
<van-cell :title="$t('cell')" icon="location" is-link /> <van-cell :title="$t('cell')" icon="location" is-link />
<van-cell :title="$t('cell')"> <van-cell :title="$t('cell')">
<template slot="right-icon"> <template slot="right-icon">
<van-icon name="search" class="van-cell__right-icon"></van-icon> <van-icon name="search" class="van-cell__right-icon" />
</template> </template>
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
</demo-block> </demo-block>
</demo-section> </demo-section>
</template> </template>
<script> <script>
@ -83,4 +83,4 @@ export default {
vertical-align: middle; vertical-align: middle;
} }
} }
</style> </style>

View File

@ -20,8 +20,8 @@
<van-popup v-model="showEdit" position="bottom"> <van-popup v-model="showEdit" position="bottom">
<van-contact-edit <van-contact-edit
:contactInfo="editingContact" :contact-info="editingContact"
:isEdit="isEdit" :is-edit="isEdit"
@save="onSave" @save="onSave"
@delete="onDelete" @delete="onDelete"
/> />

View File

@ -3,15 +3,15 @@
<demo-block :title="$t('basicUsage')"> <demo-block :title="$t('basicUsage')">
<van-coupon-cell <van-coupon-cell
:coupons="coupons" :coupons="coupons"
:chosenCoupon="chosenCoupon" :chosen-coupon="chosenCoupon"
@click="showList = true" @click="showList = true"
/> />
<van-popup v-model="showList" position="bottom"> <van-popup v-model="showList" position="bottom">
<van-coupon-list <van-coupon-list
:coupons="coupons" :coupons="coupons"
:chosenCoupon="chosenCoupon" :chosen-coupon="chosenCoupon"
:disabledCoupons="disabledCoupons" :disabled-coupons="disabledCoupons"
@change="onChange" @change="onChange"
@exchange="onExchange" @exchange="onExchange"
/> />
@ -21,6 +21,7 @@
</template> </template>
<script> <script>
/* eslint-disable camelcase */
export default { export default {
i18n: { i18n: {
'zh-CN': { 'zh-CN': {
@ -67,7 +68,7 @@ export default {
name: this.$t('coupon.name'), name: this.$t('coupon.name'),
start_at: 1489104000, start_at: 1489104000,
end_at: 1514592000 end_at: 1514592000
} };
}, },
discountCoupon() { discountCoupon() {
@ -78,7 +79,7 @@ export default {
denominations: 0, denominations: 0,
origin_condition: 50, origin_condition: 50,
value: 12 value: 12
} };
}, },
disabledCoupon() { disabledCoupon() {
@ -87,7 +88,7 @@ export default {
id: 3, id: 3,
available: 0, available: 0,
reason: this.$t('coupon.reason') reason: this.$t('coupon.reason')
} };
}, },
disabledDiscountCoupon() { disabledDiscountCoupon() {
@ -96,13 +97,13 @@ export default {
id: 4, id: 4,
available: 0, available: 0,
reason: this.$t('coupon.reason') reason: this.$t('coupon.reason')
} };
} }
}, },
methods: { methods: {
onChange(index) { onChange(index) {
this.showList = false; this.showList = false;
this.chosenCoupon = index; this.chosenCoupon = index;
}, },
onExchange(code) { onExchange(code) {

View File

@ -4,10 +4,10 @@
<van-datetime-picker <van-datetime-picker
v-model="currentDate1" v-model="currentDate1"
type="datetime" type="datetime"
:minHour="minHour" :min-hour="minHour"
:maxHour="maxHour" :max-hour="maxHour"
:minDate="minDate" :min-date="minDate"
:maxDate="maxDate" :max-date="maxDate"
/> />
</demo-block> </demo-block>
@ -15,9 +15,9 @@
<van-datetime-picker <van-datetime-picker
v-model="currentDate2" v-model="currentDate2"
type="date" type="date"
:minHour="minHour" :min-hour="minHour"
:maxHour="maxHour" :max-hour="maxHour"
:minDate="minDate" :min-date="minDate"
/> />
</demo-block> </demo-block>
@ -25,9 +25,9 @@
<van-datetime-picker <van-datetime-picker
v-model="currentDate3" v-model="currentDate3"
type="time" type="time"
:minHour="minHour" :min-hour="minHour"
:maxHour="maxHour" :max-hour="maxHour"
:minDate="minDate" :min-date="minDate"
/> />
</demo-block> </demo-block>
</demo-section> </demo-section>

View File

@ -44,13 +44,12 @@ export default {
Dialog.confirm({ Dialog.confirm({
title: this.$t('title'), title: this.$t('title'),
message: this.$t('content') message: this.$t('content')
}) });
} }
} }
}; };
</script> </script>
<style lang="postcss"> <style lang="postcss">
.demo-dialog { .demo-dialog {
.van-button { .van-button {

View File

@ -2,7 +2,7 @@
<demo-section> <demo-section>
<demo-block :title="$t('basicUsage')"> <demo-block :title="$t('basicUsage')">
<van-cell-group> <van-cell-group>
<van-field v-model="value" :placeholder="$t('usernamePlaceholder')"></van-field> <van-field v-model="value" :placeholder="$t('usernamePlaceholder')" />
</van-cell-group> </van-cell-group>
</demo-block> </demo-block>
@ -15,28 +15,27 @@
:placeholder="$t('usernamePlaceholder')" :placeholder="$t('usernamePlaceholder')"
required required
@click-icon="username = ''" @click-icon="username = ''"
> />
</van-field>
<van-field <van-field
v-model="password" v-model="password"
type="password" type="password"
:label="$t('password')" :label="$t('password')"
:placeholder="$t('passwordPlaceholder')" :placeholder="$t('passwordPlaceholder')"
required> required
</van-field> />
</van-cell-group> </van-cell-group>
</demo-block> </demo-block>
<demo-block :title="$t('title3')"> <demo-block :title="$t('title3')">
<van-cell-group> <van-cell-group>
<van-field :value="$t('inputDisabled')" :label="$t('username')" disabled></van-field> <van-field :value="$t('inputDisabled')" :label="$t('username')" disabled />
</van-cell-group> </van-cell-group>
</demo-block> </demo-block>
<demo-block :title="$t('title4')"> <demo-block :title="$t('title4')">
<van-cell-group> <van-cell-group>
<van-field :label="$t('username')" :placeholder="$t('usernamePlaceholder')" error></van-field> <van-field :label="$t('username')" :placeholder="$t('usernamePlaceholder')" error />
</van-cell-group> </van-cell-group>
</demo-block> </demo-block>
@ -49,8 +48,7 @@
:placeholder="$t('messagePlaceholder')" :placeholder="$t('messagePlaceholder')"
rows="1" rows="1"
autosize autosize
> />
</van-field>
</van-cell-group> </van-cell-group>
</demo-block> </demo-block>
</demo-section> </demo-section>

View File

@ -58,7 +58,6 @@ export default {
}; };
</script> </script>
<style lang="postcss"> <style lang="postcss">
.demo-goods-action { .demo-goods-action {
.van-goods-action { .van-goods-action {

View File

@ -26,7 +26,7 @@ export default {
this.icons = icons.glyphs.map(icon => icon.css); this.icons = icons.glyphs.map(icon => icon.css);
return {}; return {};
} }
} };
</script> </script>
<style lang="postcss"> <style lang="postcss">

View File

@ -60,4 +60,4 @@ export default {
pointer-events: none; pointer-events: none;
} }
} }
</style> </style>

View File

@ -37,7 +37,7 @@ export default {
title2: 'Column Spacing' title2: 'Column Spacing'
} }
} }
} };
</script> </script>
<style lang="postcss"> <style lang="postcss">
@ -67,4 +67,4 @@ export default {
} }
} }
} }
</style> </style>

View File

@ -1,7 +1,7 @@
<template> <template>
<demo-section> <demo-section>
<demo-block :title="$t('basicUsage')"> <demo-block :title="$t('basicUsage')">
<img v-for="img in imageList" v-lazy="img" /> <img v-for="img in imageList" v-lazy="img" >
</demo-block> </demo-block>
<demo-block :title="$t('title2')"> <demo-block :title="$t('title2')">
@ -10,7 +10,7 @@
<demo-block :title="$t('title3')"> <demo-block :title="$t('title3')">
<lazy-component> <lazy-component>
<img v-for="img in componentImageList" v-lazy="img" /> <img v-for="img in componentImageList" v-lazy="img" >
</lazy-component> </lazy-component>
</demo-block> </demo-block>
</demo-section> </demo-section>
@ -53,7 +53,7 @@ export default {
console.log('component show'); console.log('component show');
} }
} }
} };
</script> </script>
<style lang="postcss"> <style lang="postcss">
@ -79,4 +79,4 @@ export default {
padding-left: 0; padding-left: 0;
} }
} }
</style> </style>

View File

@ -31,7 +31,7 @@ export default {
title3: 'Spinner' title3: 'Spinner'
} }
} }
} };
</script> </script>
<style lang="postcss"> <style lang="postcss">

View File

@ -3,16 +3,16 @@
<demo-block :title="$t('basicUsage')"> <demo-block :title="$t('basicUsage')">
<van-nav-bar <van-nav-bar
:title="$t('title')" :title="$t('title')"
:leftText="$t('back')" :left-text="$t('back')"
:rightText="$t('button')" :right-text="$t('button')"
leftArrow left-arrow
@click-left="onClickLeft" @click-left="onClickLeft"
@click-right="onClickRight" @click-right="onClickRight"
/> />
</demo-block> </demo-block>
<demo-block :title="$t('advancedUsage')"> <demo-block :title="$t('advancedUsage')">
<van-nav-bar :title="$t('title')" :leftText="$t('back')" leftArrow> <van-nav-bar :title="$t('title')" :left-text="$t('back')" left-arrow>
<van-icon name="search" slot="right" /> <van-icon name="search" slot="right" />
</van-nav-bar> </van-nav-bar>
</demo-block> </demo-block>
@ -29,5 +29,5 @@ export default {
Toast(this.$t('button')); Toast(this.$t('button'));
} }
} }
} };
</script> </script>

View File

@ -3,7 +3,7 @@
<demo-block :title="$t('basicUsage')"> <demo-block :title="$t('basicUsage')">
<van-notice-bar <van-notice-bar
:text="$t('text')" :text="$t('text')"
leftIcon="//img.yzcdn.cn/public_files/2017/8/10/6af5b7168eed548100d9041f07b7c616.png" left-icon="//img.yzcdn.cn/public_files/2017/8/10/6af5b7168eed548100d9041f07b7c616.png"
/> />
</demo-block> </demo-block>
@ -32,7 +32,7 @@ export default {
text: 'Only those who have the patience to do simple things perfectly ever acquire the skill to do difficult things easily.' text: 'Only those who have the patience to do simple things perfectly ever acquire the skill to do difficult things easily.'
} }
} }
} };
</script> </script>
<style lang="postcss"> <style lang="postcss">
@ -41,4 +41,4 @@ export default {
margin-top: 15px; margin-top: 15px;
} }
} }
</style> </style>

View File

@ -7,8 +7,8 @@
<van-number-keyboard <van-number-keyboard
:show="keyboard === 'default'" :show="keyboard === 'default'"
:closeButtonText="$t('close')" :close-button-text="$t('close')"
extraKey="." extra-key="."
@blur="keyboard = ''" @blur="keyboard = ''"
@input="onInput" @input="onInput"
@delete="onDelete" @delete="onDelete"
@ -22,9 +22,9 @@
<van-number-keyboard <van-number-keyboard
:show="keyboard === 'custom'" :show="keyboard === 'custom'"
:closeButtonText="$t('close')" :close-button-text="$t('close')"
theme="custom" theme="custom"
extraKey="." extra-key="."
@blur="keyboard = ''" @blur="keyboard = ''"
@input="onInput" @input="onInput"
@delete="onDelete" @delete="onDelete"

View File

@ -1,34 +1,34 @@
<template> <template>
<demo-section> <demo-section>
<demo-block :title="$t('basicUsage')"> <demo-block :title="$t('basicUsage')">
<van-pagination <van-pagination
v-model="currentPage1" v-model="currentPage1"
:totalItems="24" :total-items="24"
:itemsPerPage="5" :items-per-page="5"
:previousText= "$t('prevText')" :previous-text= "$t('prevText')"
:nextText= "$t('nextText')" :next-text= "$t('nextText')"
/> />
</demo-block> </demo-block>
<demo-block :title="$t('title2')"> <demo-block :title="$t('title2')">
<van-pagination <van-pagination
v-model="currentPage2" v-model="currentPage2"
:pageCount="12" :page-count="12"
:previousText= "$t('prevText')" :previous-text= "$t('prevText')"
:nextText= "$t('nextText')" :next-text= "$t('nextText')"
mode="simple" mode="simple"
size="small" size="small"
/> />
</demo-block> </demo-block>
<demo-block :title="$t('title3')"> <demo-block :title="$t('title3')">
<van-pagination <van-pagination
forceEllipses force-ellipses
v-model="currentPage3" v-model="currentPage3"
:totalItems="125" :total-items="125"
:showPageSize="3" :show-page-size="3"
:previousText= "$t('prevText')" :previous-text= "$t('prevText')"
:nextText= "$t('nextText')" :next-text= "$t('nextText')"
/> />
</demo-block> </demo-block>
</demo-section> </demo-section>
@ -55,7 +55,7 @@ export default {
return { return {
currentPage1: 1, currentPage1: 1,
currentPage2: 1, currentPage2: 1,
currentPage3: 1, currentPage3: 1
}; };
} }
}; };

View File

@ -32,4 +32,4 @@
padding: 20px; padding: 20px;
} }
} }
</style> </style>

View File

@ -10,7 +10,7 @@
<demo-block :title="$t('title3')"> <demo-block :title="$t('title3')">
<van-picker <van-picker
showToolbar show-toolbar
:title="$t('area')" :title="$t('area')"
:columns="$t('column1')" :columns="$t('column1')"
@cancel="onCancel" @cancel="onCancel"
@ -49,7 +49,6 @@ export default {
title2: 'Disable Option', title2: 'Disable Option',
title3: 'Show Toolbar', title3: 'Show Toolbar',
title4: 'Multi Columns', title4: 'Multi Columns',
title2: 'Picker with toolbar',
column1: ['Delaware', 'Florida', 'Georqia', 'Indiana', 'Maine'], column1: ['Delaware', 'Florida', 'Georqia', 'Indiana', 'Maine'],
column2: [ column2: [
{ text: 'Delaware', disabled: true }, { text: 'Delaware', disabled: true },

View File

@ -31,7 +31,7 @@
<van-button @click="show4 = false">{{ $t('button6') }}</van-button> <van-button @click="show4 = false">{{ $t('button6') }}</van-button>
</van-popup> </van-popup>
</demo-block> </demo-block>
</demo-section> </demo-section>
</template> </template>
<script> <script>
@ -63,7 +63,7 @@ export default {
show2: false, show2: false,
show3: false, show3: false,
show4: false show4: false
} };
}, },
watch: { watch: {
@ -81,7 +81,7 @@ export default {
Dialog.confirm({ Dialog.confirm({
title: 'confirm标题', title: 'confirm标题',
message: '弹窗提示文字左右始终距离边20PX上下距离20PX文字左对齐。弹窗提示文字左右始终距离边20PX上下距离20PX文字左对齐。' message: '弹窗提示文字左右始终距离边20PX上下距离20PX文字左对齐。弹窗提示文字左右始终距离边20PX上下距离20PX文字左对齐。'
}) });
} }
} }
}; };
@ -138,4 +138,4 @@ export default {
} }
} }
} }
</style> </style>

View File

@ -13,9 +13,9 @@
</demo-block> </demo-block>
<demo-block :title="$t('title3')"> <demo-block :title="$t('title3')">
<van-progress :pivotText="$t('red')" color="#ed5050" :percentage="26" /> <van-progress :pivot-text="$t('red')" color="#ed5050" :percentage="26" />
<van-progress :pivotText="$t('orange')" color="#f60" :percentage="46" /> <van-progress :pivot-text="$t('orange')" color="#f60" :percentage="46" />
<van-progress :pivotText="$t('yellow')" color="#f09000" :percentage="66" /> <van-progress :pivot-text="$t('yellow')" color="#f09000" :percentage="66" />
</demo-block> </demo-block>
</demo-section> </demo-section>
</template> </template>
@ -32,7 +32,7 @@ export default {
title3: 'Custom Style' title3: 'Custom Style'
} }
} }
} };
</script> </script>
<style lang="postcss"> <style lang="postcss">
@ -44,5 +44,5 @@ export default {
margin-top: 10px; margin-top: 10px;
} }
} }
} }
</style> </style>

View File

@ -81,7 +81,7 @@ export default {
float: right; float: right;
position: static; position: static;
} }
.van-radio__label { .van-radio__label {
margin: 0; margin: 0;
} }

View File

@ -9,7 +9,7 @@
<van-search <van-search
v-model="value" v-model="value"
:placeholder="$t('placeholder')" :placeholder="$t('placeholder')"
:showAction="true" :show-action="true"
@search="onSearch" @search="onSearch"
@cancel="onCancel" @cancel="onCancel"
/> />
@ -19,8 +19,9 @@
<demo-block :title="$t('title3')"> <demo-block :title="$t('title3')">
<van-search <van-search
v-model="value" v-model="value"
:showAction="true" :show-action="true"
@search="onSearch"> @search="onSearch"
>
<div slot="action" @click="onSearch">{{ $t('search') }}</div> <div slot="action" @click="onSearch">{{ $t('search') }}</div>
</van-search> </van-search>
</demo-block> </demo-block>
@ -44,7 +45,7 @@ export default {
data() { data() {
return { return {
value: '', value: ''
}; };
}, },
@ -65,4 +66,4 @@ export default {
padding: 0 10px; padding: 0 10px;
} }
} }
</style> </style>

View File

@ -6,16 +6,15 @@
v-model="showBase" v-model="showBase"
:sku="$t('sku').sku" :sku="$t('sku').sku"
:goods="$t('sku').goods_info" :goods="$t('sku').goods_info"
:goodsId="$t('sku').goods_id" :goods-id="$t('sku').goods_id"
:hideStock="$t('sku').sku.hide_stock" :hide-stock="$t('sku').sku.hide_stock"
:quota="$t('sku').quota" :quota="$t('sku').quota"
:quotaUsed="$t('sku').quota_used" :quota-used="$t('sku').quota_used"
:resetStepperOnHide="true" :reset-stepper-on-hide="true"
:disableStepperInput="true" :disable-stepper-input="true"
@buy-clicked="handleBuyClicked" @buy-clicked="handleBuyClicked"
@add-cart="handleAddCartClicked" @add-cart="handleAddCartClicked"
> />
</van-sku>
<van-button type="primary" @click="showBase = true" block>{{ $t('basicUsage') }}</van-button> <van-button type="primary" @click="showBase = true" block>{{ $t('basicUsage') }}</van-button>
</div> </div>
</demo-block> </demo-block>
@ -24,24 +23,24 @@
<div class="sku-container"> <div class="sku-container">
<van-sku <van-sku
v-model="showCustomAction" v-model="showCustomAction"
:stepperTitle="$t('stepperTitle')" :stepper-title="$t('stepperTitle')"
:sku="$t('sku').sku" :sku="$t('sku').sku"
:goods="$t('sku').goods_info" :goods="$t('sku').goods_info"
:goodsId="$t('sku').goods_id" :goods-id="$t('sku').goods_id"
:hideStock="$t('sku').sku.hide_stock" :hide-stock="$t('sku').sku.hide_stock"
:showAddCartBtn="true" :show-add-cart-btn="true"
:quota="$t('sku').quota" :quota="$t('sku').quota"
:quotaUsed="$t('sku').quota_used" :quota-used="$t('sku').quota_used"
:resetStepperOnHide="true" :reset-stepper-on-hide="true"
:initialSku="initialSku" :initial-sku="initialSku"
@buy-clicked="handleBuyClicked" @buy-clicked="handleBuyClicked"
@add-cart="handleAddCartClicked" @add-cart="handleAddCartClicked"
> >
<template slot="sku-messages"></template> <template slot="sku-messages" />
<template slot="sku-actions" slot-scope="props"> <template slot="sku-actions" slot-scope="props">
<div class="van-sku-actions"> <div class="van-sku-actions">
<van-button bottomAction @click="handlePointClicked">{{ $t('button1') }}</van-button> <van-button bottom-action @click="handlePointClicked">{{ $t('button1') }}</van-button>
<van-button type="primary" bottomAction @click="props.skuEventBus.$emit('sku:buy')">{{ $t('button2') }}</van-button> <van-button type="primary" bottom-action @click="props.skuEventBus.$emit('sku:buy')">{{ $t('button2') }}</van-button>
</div> </div>
</template> </template>
</van-sku> </van-sku>

View File

@ -9,9 +9,9 @@
</demo-block> </demo-block>
<demo-block :title="$t('advancedUsage')"> <demo-block :title="$t('advancedUsage')">
<van-stepper v-model="stepper2" min="5" max="40" step="2" defaultValue="9" /> <van-stepper v-model="stepper2" min="5" max="40" step="2" default-value="9" />
</demo-block> </demo-block>
</demo-section> </demo-section>
</template> </template>
<script> <script>
@ -19,7 +19,7 @@ export default {
data() { data() {
return { return {
stepper1: 1, stepper1: 1,
stepper2: null, stepper2: null
}; };
} }
}; };
@ -31,4 +31,4 @@ export default {
margin-left: 15px; margin-left: 15px;
} }
} }
</style> </style>

View File

@ -9,7 +9,7 @@
</van-steps> </van-steps>
<van-button @click="nextStep">{{ $t('nextStep') }}</van-button> <van-button @click="nextStep">{{ $t('nextStep') }}</van-button>
</demo-block> </demo-block>
<demo-block :title="$t('title2')"> <demo-block :title="$t('title2')">
<van-steps <van-steps
@ -28,19 +28,19 @@
<demo-block :title="$t('title3')"> <demo-block :title="$t('title3')">
<van-steps direction="vertical" :active="0" active-color="#f60"> <van-steps direction="vertical" :active="0" active-color="#f60">
<van-step> <van-step>
<h3>{{ $t('status1') }}</h3> <h3>{{ $t('status1') }}</h3>
<p>2016-07-12 12:40</p> <p>2016-07-12 12:40</p>
</van-step> </van-step>
<van-step> <van-step>
<h3>{{ $t('status2') }}</h3> <h3>{{ $t('status2') }}</h3>
<p>2016-07-11 10:00</p> <p>2016-07-11 10:00</p>
</van-step> </van-step>
<van-step> <van-step>
<h3>{{ $t('status3') }}</h3> <h3>{{ $t('status3') }}</h3>
<p>2016-07-10 09:30</p> <p>2016-07-10 09:30</p>
</van-step> </van-step>
</van-steps> </van-steps>
</demo-block> </demo-block>
</demo-section> </demo-section>
</template> </template>
@ -85,7 +85,7 @@ export default {
this.active = ++this.active % 4; this.active = ++this.active % 4;
} }
} }
} };
</script> </script>
<style lang="postcss"> <style lang="postcss">
@ -110,4 +110,4 @@ export default {
font-weight: normal; font-weight: normal;
} }
} }
</style> </style>

View File

@ -3,7 +3,7 @@
<demo-block :title="$t('basicUsage')"> <demo-block :title="$t('basicUsage')">
<van-submit-bar <van-submit-bar
:price="3050" :price="3050"
:buttonText="$t('submit')" :button-text="$t('submit')"
@submit="onClickButton" @submit="onClickButton"
/> />
</demo-block> </demo-block>
@ -12,7 +12,7 @@
<van-submit-bar <van-submit-bar
disabled disabled
:price="3050" :price="3050"
:buttonText="$t('submit')" :button-text="$t('submit')"
:tip="$t('tip1')" :tip="$t('tip1')"
@submit="onClickButton" @submit="onClickButton"
/> />
@ -22,7 +22,7 @@
<van-submit-bar <van-submit-bar
loading loading
:price="3050" :price="3050"
:buttonText="$t('submit')" :button-text="$t('submit')"
@submit="onClickButton" @submit="onClickButton"
/> />
</demo-block> </demo-block>
@ -30,7 +30,7 @@
<demo-block :title="$t('advancedUsage')"> <demo-block :title="$t('advancedUsage')">
<van-submit-bar <van-submit-bar
:price="3050" :price="3050"
:buttonText="$t('submit')" :button-text="$t('submit')"
@submit="onClickButton" @submit="onClickButton"
> >
<van-checkbox v-model="checked">{{ $t('check') }}</van-checkbox> <van-checkbox v-model="checked">{{ $t('check') }}</van-checkbox>

View File

@ -12,7 +12,7 @@
<demo-block :title="$t('title2')"> <demo-block :title="$t('title2')">
<van-swipe :autoplay="3000"> <van-swipe :autoplay="3000">
<van-swipe-item v-for="(image, index) in images" :key="index"> <van-swipe-item v-for="(image, index) in images" :key="index">
<img v-lazy="image" /> <img v-lazy="image" >
</van-swipe-item> </van-swipe-item>
</van-swipe> </van-swipe>
</demo-block> </demo-block>
@ -77,4 +77,4 @@ export default {
} }
} }
} }
</style> </style>

View File

@ -22,15 +22,6 @@
<script> <script>
export default { export default {
i18n: {
'zh-CN': {
},
'en-US': {
}
},
data() { data() {
return { return {
checked: true checked: true
@ -38,8 +29,3 @@ export default {
} }
}; };
</script> </script>
<style lang="postcss">
</style>

View File

@ -51,7 +51,6 @@ export default {
}; };
</script> </script>
<style lang="postcss"> <style lang="postcss">
.demo-switch { .demo-switch {
.van-switch { .van-switch {

View File

@ -14,7 +14,7 @@
<van-tabbar-item icon="shop"> <van-tabbar-item icon="shop">
<span>{{ $t('custom') }}</span> <span>{{ $t('custom') }}</span>
<template slot="icon" slot-scope="props"> <template slot="icon" slot-scope="props">
<img :src="props.active ? icon.active : icon.normal" /> <img :src="props.active ? icon.active : icon.normal" >
</template> </template>
</van-tabbar-item> </van-tabbar-item>
<van-tabbar-item icon="chat">{{ $t('tab') }}</van-tabbar-item> <van-tabbar-item icon="chat">{{ $t('tab') }}</van-tabbar-item>
@ -43,12 +43,11 @@ export default {
normal: 'https://img.yzcdn.cn/public_files/2017/10/13/c547715be149dd3faa817e4a948b40c4.png', normal: 'https://img.yzcdn.cn/public_files/2017/10/13/c547715be149dd3faa817e4a948b40c4.png',
active: 'https://img.yzcdn.cn/public_files/2017/10/13/793c77793db8641c4c325b7f25bf130d.png' active: 'https://img.yzcdn.cn/public_files/2017/10/13/793c77793db8641c4c325b7f25bf130d.png'
} }
} };
} }
} };
</script> </script>
<style lang="postcss"> <style lang="postcss">
.demo-tabbar { .demo-tabbar {
.van-tabbar { .van-tabbar {

View File

@ -85,7 +85,6 @@ export default {
}; };
</script> </script>
<style lang="postcss"> <style lang="postcss">
.demo-toast { .demo-toast {
.van-button { .van-button {

View File

@ -3,8 +3,8 @@
<demo-block :title="$t('basicUsage')"> <demo-block :title="$t('basicUsage')">
<van-tree-select <van-tree-select
:items="items" :items="items"
:mainActiveIndex="mainActiveIndex" :main-active-index="mainActiveIndex"
:activeId="activeId" :active-id="activeId"
@navclick="onNavClick" @navclick="onNavClick"
@itemclick="onItemClick" @itemclick="onItemClick"
/> />
@ -110,10 +110,5 @@ export default {
this.activeId = data.id; this.activeId = data.id;
} }
} }
} };
</script> </script>
<style lang="postcss">
</style>

View File

@ -40,7 +40,7 @@ export default {
loadMore() { loadMore() {
this.disabled = true; this.disabled = true;
setTimeout(() => { setTimeout(() => {
for (let i = 0; i < 5; i ++) { for (let i = 0; i < 5; i++) {
this.list.push(this.list.length); this.list.push(this.list.length);
} }
this.disabled = false; this.disabled = false;
@ -50,7 +50,6 @@ export default {
}; };
</script> </script>
<style lang="postcss"> <style lang="postcss">
.demo-waterfall { .demo-waterfall {
ul { ul {

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="app"> <div class="app">
<van-doc :simulators="simulators" :currentSimulator="currentSimulator" :config="config" :base="base"> <van-doc :simulators="simulators" :current-simulator="currentSimulator" :config="config" :base="base">
<router-view @changeDemoURL="onChangeDemoURL"></router-view> <router-view @changeDemoURL="onChangeDemoURL" />
</van-doc> </van-doc>
</div> </div>
</template> </template>

View File

@ -1,5 +1,5 @@
<template> <template>
<router-view></router-view> <router-view />
</template> </template>
<style lang="postcss"> <style lang="postcss">

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="side-nav"> <div class="side-nav">
<h1 class="zanui-title"> <h1 class="zanui-title">
<img src="https://img.yzcdn.cn/public_files/2017/12/18/fd78cf6bb5d12e2a119d0576bedfd230.png" /> <img src="https://img.yzcdn.cn/public_files/2017/12/18/fd78cf6bb5d12e2a119d0576bedfd230.png" >
<span>Vant</span> <span>Vant</span>
</h1> </h1>
<div class="mobile-switch-lang"> <div class="mobile-switch-lang">

View File

@ -9,7 +9,7 @@
> >
<h4>{{ demo.title }}</h4> <h4>{{ demo.title }}</h4>
<a :href="demo.source" target="_blank">{{ $t('source') }}</a> <a :href="demo.source" target="_blank">{{ $t('source') }}</a>
<img :src="demo.preview" @click="onChangeDemo(demo, index)" /> <img :src="demo.preview" @click="onChangeDemo(demo, index)" >
</div> </div>
</div> </div>
</section> </section>

View File

@ -6,7 +6,7 @@
'mobile-nav-group__title--open': isOpen 'mobile-nav-group__title--open': isOpen
}" }"
@click="handleNavTitleClick"> @click="handleNavTitleClick">
{{group.groupName}} {{ group.groupName }}
</div> </div>
<div class="mobile-nav-group__list-wrapper" :class="{ 'mobile-nav-group__list-wrapper--open': isOpen }"> <div class="mobile-nav-group__list-wrapper" :class="{ 'mobile-nav-group__list-wrapper--open': isOpen }">
<ul class="mobile-nav-group__list" :class="{ 'mobile-nav-group__list--open': isOpen }"> <ul class="mobile-nav-group__list" :class="{ 'mobile-nav-group__list--open': isOpen }">
@ -22,7 +22,7 @@
{{ navItem.title }} {{ navItem.title }}
</p> </p>
</router-link> </router-link>
<van-icon name="arrow"></van-icon> <van-icon name="arrow" />
</li> </li>
</template> </template>
</ul> </ul>

View File

@ -66,7 +66,7 @@
"css-loader": "^0.28.7", "css-loader": "^0.28.7",
"dependency-tree": "^5.12.0", "dependency-tree": "^5.12.0",
"eslint": "^4.13.1", "eslint": "^4.13.1",
"eslint-plugin-vue": "^2.1.0", "eslint-plugin-vue": "^4.0.0-beta.4",
"extract-text-webpack-plugin": "3.0.2", "extract-text-webpack-plugin": "3.0.2",
"fast-vue-md-loader": "^1.0.3", "fast-vue-md-loader": "^1.0.3",
"friendly-errors-webpack-plugin": "^1.6.1", "friendly-errors-webpack-plugin": "^1.6.1",
@ -95,7 +95,7 @@
"style-loader": "^0.19.1", "style-loader": "^0.19.1",
"uppercamelcase": "^3.0.0", "uppercamelcase": "^3.0.0",
"url-loader": "^0.6.2", "url-loader": "^0.6.2",
"vant-doc": "0.3.19", "vant-doc": "0.3.20",
"vue": "^2.5.13", "vue": "^2.5.13",
"vue-loader": "^13.6.1", "vue-loader": "^13.6.1",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",

View File

@ -27,7 +27,7 @@
@click.stop="$emit('input', false)" @click.stop="$emit('input', false)"
/> />
<div v-else class="van-actionsheet__content"> <div v-else class="van-actionsheet__content">
<slot></slot> <slot />
</div> </div>
</div> </div>
</transition> </transition>

View File

@ -9,7 +9,7 @@
rows="1" rows="1"
:value="value" :value="value"
:error="isError" :error="isError"
:onIconClick="onIconClick" :on-icon-click="onIconClick"
@input="$emit('input', $event)" @input="$emit('input', $event)"
@focus="handleFocus" @focus="handleFocus"
@blur="handleBlur" @blur="handleBlur"

View File

@ -24,9 +24,9 @@
</cell> </cell>
<address-edit-detail <address-edit-detail
:value="currentInfo.address_detail" :value="currentInfo.address_detail"
:isError="errorInfo.address_detail" :is-error="errorInfo.address_detail"
:showSearchResult="showSearchResult" :show-search-result="showSearchResult"
:searchResult="searchResult" :search-result="searchResult"
@focus="onFocus('address_detail')" @focus="onFocus('address_detail')"
@blur="onDetailBlur" @blur="onDetailBlur"
@input="onChangeDetail" @input="onChangeDetail"
@ -44,7 +44,7 @@
:error="errorInfo.postal_code" :error="errorInfo.postal_code"
@focus="onFocus('postal_code')" @focus="onFocus('postal_code')"
/> />
<switch-cell <switch-cell
v-if="showSetDefault" v-if="showSetDefault"
v-show="!hideBottomFields" v-show="!hideBottomFields"
v-model="currentInfo.is_default" v-model="currentInfo.is_default"
@ -63,7 +63,7 @@
<van-area <van-area
ref="area" ref="area"
:value="currentInfo.area_code" :value="currentInfo.area_code"
:areaList="areaList" :area-list="areaList"
@confirm="onAreaConfirm" @confirm="onAreaConfirm"
@cancel="showAreaSelect = false" @cancel="showAreaSelect = false"
/> />

View File

@ -16,7 +16,7 @@
class="van-address-list__add van-hairline--top" class="van-address-list__add van-hairline--top"
@click="$emit('add')" @click="$emit('add')"
:title="addButtonText || $t('add')" :title="addButtonText || $t('add')"
isLink is-link
/> />
</div> </div>
</template> </template>

View File

@ -2,8 +2,8 @@
<picker <picker
class="van-area" class="van-area"
ref="picker" ref="picker"
showToolbar show-toolbar
valueKey="name" value-key="name"
:title="title" :title="title"
:columns="columns" :columns="columns"
@change="onChange" @change="onChange"

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="van-badge-group van-hairline--top-bottom"> <div class="van-badge-group van-hairline--top-bottom">
<slot></slot> <slot />
</div> </div>
</template> </template>

View File

@ -14,8 +14,8 @@
'van-button--bottom-action': bottomAction 'van-button--bottom-action': bottomAction
} }
]" ]"
@click="onClick" @click="onClick"
> >
<loading <loading
v-if="loading" v-if="loading"
class="van-button__icon-loading" class="van-button__icon-loading"
@ -23,7 +23,7 @@
:color="type === 'default' ? 'black' : 'white'" :color="type === 'default' ? 'black' : 'white'"
/> />
<span class="van-button__text"> <span class="van-button__text">
<slot></slot> <slot />
</span> </span>
</component> </component>
</template> </template>

View File

@ -2,7 +2,7 @@
<div class="van-card" :class="{ 'van-card--center': centered }"> <div class="van-card" :class="{ 'van-card--center': centered }">
<div class="van-card__thumb"> <div class="van-card__thumb">
<slot name="thumb"> <slot name="thumb">
<img :src="thumb" class="van-card__img" /> <img :src="thumb" class="van-card__img" >
</slot> </slot>
</div> </div>
<div class="van-card__content"> <div class="van-card__content">
@ -18,10 +18,10 @@
<div v-if="num !== undefined" class="van-card__num">x {{ num }}</div> <div v-if="num !== undefined" class="van-card__num">x {{ num }}</div>
</div> </div>
</slot> </slot>
<slot name="tags"></slot> <slot name="tags" />
</div> </div>
<div class="van-card__footer" v-if="$slots.footer"> <div class="van-card__footer" v-if="$slots.footer">
<slot name="footer"></slot> <slot name="footer" />
</div> </div>
</div> </div>
</template> </template>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="van-cell-group" :class="{ 'van-hairline--top-bottom': border }"> <div class="van-cell-group" :class="{ 'van-hairline--top-bottom': border }">
<slot></slot> <slot />
</div> </div>
</template> </template>

View File

@ -1,5 +1,5 @@
<template> <template>
<div <div
v-clickoutside:touchstart="onClick" v-clickoutside:touchstart="onClick"
class="van-cell-swipe" class="van-cell-swipe"
@click="onClick('cell')" @click="onClick('cell')"
@ -10,11 +10,11 @@
> >
<div class="van-cell-swipe__wrapper" :style="wrapperStyle" @transitionend="swipe = false"> <div class="van-cell-swipe__wrapper" :style="wrapperStyle" @transitionend="swipe = false">
<div class="van-cell-swipe__left" @click.stop="onClick('left')" v-if="leftWidth"> <div class="van-cell-swipe__left" @click.stop="onClick('left')" v-if="leftWidth">
<slot name="left"></slot> <slot name="left" />
</div> </div>
<slot></slot> <slot />
<div class="van-cell-swipe__right" @click.stop="onClick('right')" v-if="rightWidth"> <div class="van-cell-swipe__right" @click.stop="onClick('right')" v-if="rightWidth">
<slot name="right"></slot> <slot name="right" />
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="van-checkbox-group"> <div class="van-checkbox-group">
<slot></slot> <slot />
</div> </div>
</template> </template>

View File

@ -2,20 +2,21 @@
<div <div
class="van-checkbox" class="van-checkbox"
:class="[ :class="[
`van-checkbox--${shape}`, { `van-checkbox--${shape}`,
'van-checkbox--disabled': isDisabled { 'van-checkbox--disabled': isDisabled }
}]"> ]"
>
<span class="van-checkbox__input"> <span class="van-checkbox__input">
<input <input
v-model="currentValue" v-model="currentValue"
type="checkbox" type="checkbox"
class="van-checkbox__control" class="van-checkbox__control"
:disabled="isDisabled" :disabled="isDisabled"
/> >
<icon name="success" /> <icon name="success" />
</span> </span>
<span class="van-checkbox__label" @click="onClickLabel"> <span class="van-checkbox__label" @click="onClickLabel">
<slot></slot> <slot />
</span> </span>
</div> </div>
</template> </template>

View File

@ -4,7 +4,7 @@
:class="{ [`van-col-${span}`]: span, [`van-col-offset-${offset}`]: offset}" :class="{ [`van-col-${span}`]: span, [`van-col-offset-${offset}`]: offset}"
:style="style" :style="style"
> >
<slot></slot> <slot />
</div> </div>
</template> </template>

View File

@ -7,16 +7,16 @@
:label="$t('name')" :label="$t('name')"
:placeholder="$t('namePlaceholder')" :placeholder="$t('namePlaceholder')"
:error="errorInfo.name" :error="errorInfo.name"
@focus="onFocus('name')"> @focus="onFocus('name')"
</field> />
<field <field
v-model="currentInfo.tel" v-model="currentInfo.tel"
type="tel" type="tel"
:label="$t('tel')" :label="$t('tel')"
:placeholder="$t('telPlaceholder')" :placeholder="$t('telPlaceholder')"
:error="errorInfo.tel" :error="errorInfo.tel"
@focus="onFocus('tel')"> @focus="onFocus('tel')"
</field> />
</cell-group> </cell-group>
<div class="van-contact-edit__buttons"> <div class="van-contact-edit__buttons">
<van-button block :loading="isSaving" @click="onSaveContact" type="primary">{{ $t('save') }}</van-button> <van-button block :loading="isSaving" @click="onSaveContact" type="primary">{{ $t('save') }}</van-button>

View File

@ -11,7 +11,13 @@
</cell> </cell>
</cell-group> </cell-group>
</radio-group> </radio-group>
<cell icon="add" class="van-contact-list__add van-hairline--top" @click="$emit('add')" :title="addText || $t('addText')" isLink /> <cell
icon="add"
class="van-contact-list__add van-hairline--top"
@click="$emit('add')"
:title="addText || $t('addText')"
is-link
/>
</div> </div>
</template> </template>

View File

@ -1,6 +1,6 @@
<template> <template>
<cell-group class="van-coupon-cell"> <cell-group class="van-coupon-cell">
<cell :title="title || $t('title')" :value="value" :isLink="editable" @click="$emit('click')" /> <cell :title="title || $t('title')" :value="value" :is-link="editable" @click="$emit('click')" />
</cell-group> </cell-group>
</template> </template>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="van-coupon-item" :class="{ 'van-coupon-item--disabled': disabled }"> <div class="van-coupon-item" :class="{ 'van-coupon-item--disabled': disabled }">
<div class="van-coupon-item__head"> <div class="van-coupon-item__head">
<div class="van-coupon-item__lines"></div> <div class="van-coupon-item__lines" />
<div class="van-coupon-item__gradient"> <div class="van-coupon-item__gradient">
<h2 v-html="faceAmount" /> <h2 v-html="faceAmount" />
<p>{{ conditionMessage }}</p> <p>{{ conditionMessage }}</p>

View File

@ -1,9 +1,9 @@
<template> <template>
<picker <picker
ref="picker" ref="picker"
showToolbar show-toolbar
:columns="columns" :columns="columns"
:visibleItemCount="visibleItemCount" :visible-item-count="visibleItemCount"
@change="onChange" @change="onChange"
@confirm="onConfirm" @confirm="onConfirm"
@cancel="$emit('cancel')" @cancel="$emit('cancel')"

View File

@ -12,7 +12,8 @@
'van-field--autosize': autosize, 'van-field--autosize': autosize,
'van-field--has-icon': hasIcon, 'van-field--has-icon': hasIcon,
'van-hairline--surround': border 'van-hairline--surround': border
}"> }"
>
<textarea <textarea
v-if="type === 'textarea'" v-if="type === 'textarea'"
v-bind="$attrs" v-bind="$attrs"
@ -23,12 +24,12 @@
/> />
<input <input
v-else v-else
v-bind="$attrs" v-bind="$attrs"
v-on="listeners" v-on="listeners"
class="van-field__control" class="van-field__control"
:type="type" :type="type"
:value="value" :value="value"
/> >
<div <div
v-if="hasIcon" v-if="hasIcon"
v-show="$slots.icon || value" v-show="$slots.icon || value"

View File

@ -4,7 +4,7 @@
:href="url" :href="url"
class="van-goods-action__big-btn" class="van-goods-action__big-btn"
:type="primary ? 'primary' : 'default'" :type="primary ? 'primary' : 'default'"
bottomAction bottom-action
@click="onClick" @click="onClick"
> >
<slot>{{ text }}</slot> <slot>{{ text }}</slot>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="van-goods-action"> <div class="van-goods-action">
<slot></slot> <slot />
</div> </div>
</template> </template>

View File

@ -1,6 +1,6 @@
<template> <template>
<i class="van-icon" :class="`van-icon-${name}`" v-on="$listeners"> <i class="van-icon" :class="`van-icon-${name}`" v-on="$listeners">
<slot></slot> <slot />
<div v-if="info" class="van-icon__info">{{ info }}</div> <div v-if="info" class="van-icon__info">{{ info }}</div>
</i> </i>
</template> </template>
@ -10,7 +10,9 @@ import install from '../utils/install';
export default { export default {
install, install,
name: 'van-icon', name: 'van-icon',
props: { props: {
name: String, name: String,
info: String info: String

View File

@ -7,7 +7,7 @@
@touchend="onTouchEnd" @touchend="onTouchEnd"
@touchcancel="onTouchEnd" @touchcancel="onTouchEnd"
> >
<swipe :initialSwipe="startPosition"> <swipe :initial-swipe="startPosition">
<swipe-item v-for="(item, index) in images" :key="index"> <swipe-item v-for="(item, index) in images" :key="index">
<img class="van-image-preview__image" :src="item" > <img class="van-image-preview__image" :src="item" >
</swipe-item> </swipe-item>

View File

@ -7,7 +7,7 @@
@click="$emit('click')" @click="$emit('click')"
> >
<div class="van-notice-bar__left-icon" v-if="leftIcon"> <div class="van-notice-bar__left-icon" v-if="leftIcon">
<img :src="leftIcon" /> <img :src="leftIcon" >
</div> </div>
<div class="van-notice-bar__content-wrap" ref="contentWrap"> <div class="van-notice-bar__content-wrap" ref="contentWrap">
<div <div

View File

@ -1,6 +1,6 @@
<template> <template>
<transition :name="transition ? 'van-slide-bottom' : ''"> <transition :name="transition ? 'van-slide-bottom' : ''">
<div <div
v-show="show" v-show="show"
:style="style" :style="style"
class="van-number-keyboard" class="van-number-keyboard"

View File

@ -7,10 +7,10 @@
> >
{{ prevText || $t('prev') }} {{ prevText || $t('prev') }}
</li> </li>
<li <li
v-if="isMultiMode" v-if="isMultiMode"
v-for="(page, index) in pages" v-for="(page, index) in pages"
:key="index" :key="index"
class="van-pagination__item van-pagination__page van-hairline" class="van-pagination__item van-pagination__page van-hairline"
:class="{ 'van-pagination--active': page.active }" :class="{ 'van-pagination--active': page.active }"
@click="selectPage(page.number)" @click="selectPage(page.number)"
@ -22,8 +22,8 @@
</li> </li>
<li <li
class="van-pagination__item van-pagination__next van-hairline" class="van-pagination__item van-pagination__next van-hairline"
:class="{ 'van-pagination--disabled': value === computedPageCount }" :class="{ 'van-pagination--disabled': value === computedPageCount }"
@click="selectPage(value + 1)" @click="selectPage(value + 1)"
> >
{{ nextText || $t('next') }} {{ nextText || $t('next') }}
</li> </li>
@ -144,4 +144,4 @@ export default create({
} }
} }
}); });
</script> </script>

View File

@ -8,10 +8,10 @@
</slot> </slot>
</div> </div>
<div class="van-panel__content"> <div class="van-panel__content">
<slot></slot> <slot />
</div> </div>
<div class="van-panel__footer van-hairline--top" v-if="$slots.footer"> <div class="van-panel__footer van-hairline--top" v-if="$slots.footer">
<slot name="footer"></slot> <slot name="footer" />
</div> </div>
</div> </div>
</template> </template>

View File

@ -5,12 +5,12 @@
<i :style="`visibility: ${visibility}`" /> <i :style="`visibility: ${visibility}`" />
</li> </li>
</ul> </ul>
<div <div
v-if="errorInfo || info" v-if="errorInfo || info"
v-text="errorInfo || info" v-text="errorInfo || info"
:class="errorInfo ? 'van-password-input__error-info' : 'van-password-input__info'" :class="errorInfo ? 'van-password-input__error-info' : 'van-password-input__info'"
/> />
</div> </div>
</template> </template>
<script> <script>

View File

@ -11,7 +11,7 @@
> >
<ul :style="wrapperStyle"> <ul :style="wrapperStyle">
<li <li
v-for="(option, index) in options" v-for="(option, index) in options"
v-text="getOptionText(option)" v-text="getOptionText(option)"
:class="{ :class="{
'van-picker-column--disabled': isDisabled(option), 'van-picker-column--disabled': isDisabled(option),

View File

@ -11,12 +11,12 @@
<picker-column <picker-column
v-for="(item, index) in currentColumns" v-for="(item, index) in currentColumns"
:key="index" :key="index"
:valueKey="valueKey" :value-key="valueKey"
:options="item.values" :options="item.values"
:className="item.className" :class-name="item.className"
:defaultIndex="item.defaultIndex" :default-index="item.defaultIndex"
:itemHeight="itemHeight" :item-height="itemHeight"
:visibileColumnCount="visibileColumnCount" :visibile-column-count="visibileColumnCount"
@change="onChange(index)" @change="onChange(index)"
/> />
<div class="van-picker__frame van-hairline--top-bottom" :style="frameStyle" /> <div class="van-picker__frame van-hairline--top-bottom" :style="frameStyle" />

View File

@ -1,7 +1,7 @@
<template> <template>
<transition :name="currentTransition"> <transition :name="currentTransition">
<div v-show="value" class="van-popup" :class="{ [`van-popup--${position}`]: position }"> <div v-show="value" class="van-popup" :class="{ [`van-popup--${position}`]: position }">
<slot></slot> <slot />
</div> </div>
</transition> </transition>
</template> </template>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="van-progress"> <div class="van-progress">
<span class="van-progress__portion" :style="portionStyle"></span> <span class="van-progress__portion" :style="portionStyle" />
<span class="van-progress__pivot" v-show="showPivot" :style="pivotStyle">{{ pivotText }}</span> <span class="van-progress__pivot" v-show="showPivot" :style="pivotStyle">{{ pivotText }}</span>
</div> </div>
</template> </template>

View File

@ -9,7 +9,7 @@
@touchcancel="onTouchEnd" @touchcancel="onTouchEnd"
> >
<div class="van-pull-refresh__head"> <div class="van-pull-refresh__head">
<slot name="normal" v-if="status === 'normal'"></slot> <slot name="normal" v-if="status === 'normal'"/>
<slot name="pulling" v-if="status === 'pulling'"> <slot name="pulling" v-if="status === 'pulling'">
<span class="van-pull-refresh__text">{{ pullingText || $t('pullingText') }}</span> <span class="van-pull-refresh__text">{{ pullingText || $t('pullingText') }}</span>
</slot> </slot>
@ -23,7 +23,7 @@
</div> </div>
</slot> </slot>
</div> </div>
<slot></slot> <slot />
</div> </div>
</div> </div>
</template> </template>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="van-radio-group"> <div class="van-radio-group">
<slot></slot> <slot />
</div> </div>
</template> </template>

View File

@ -14,7 +14,7 @@
<icon :name="currentValue === name ? 'checked' : 'check'" /> <icon :name="currentValue === name ? 'checked' : 'check'" />
</span> </span>
<span class="van-radio__label" @click="handleLabelClick"> <span class="van-radio__label" @click="handleLabelClick">
<slot></slot> <slot />
</span> </span>
</div> </div>
</template> </template>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="van-row" :style="style"> <div class="van-row" :style="style">
<slot></slot> <slot />
</div> </div>
</template> </template>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="van-sku-actions"> <div class="van-sku-actions">
<van-button v-if="showAddCartBtn" bottomAction @click="onAddCartClicked">{{ $t('cart') }}</van-button> <van-button v-if="showAddCartBtn" bottom-action @click="onAddCartClicked">{{ $t('cart') }}</van-button>
<van-button type="primary" bottomAction @click="onBuyClicked">{{ buyText || $t('buy') }}</van-button> <van-button type="primary" bottom-action @click="onBuyClicked">{{ buyText || $t('buy') }}</van-button>
</div> </div>
</template> </template>

View File

@ -6,7 +6,7 @@
<div class="van-sku-header__goods-info"> <div class="van-sku-header__goods-info">
<div class="van-sku__goods-name">{{ goods.title }}</div> <div class="van-sku__goods-name">{{ goods.title }}</div>
<div class="van-sku__goods-price"><span class="van-sku__price-symbol"></span><span class="van-sku__price-num">{{ price }}</span></div> <div class="van-sku__goods-price"><span class="van-sku__price-symbol"></span><span class="van-sku__price-num">{{ price }}</span></div>
<span class="van-sku__close-icon" @click="onCloseClicked"></span> <span class="van-sku__close-icon" @click="onCloseClicked" />
</div> </div>
</div> </div>
</template> </template>

View File

@ -1,23 +1,25 @@
<template> <template>
<cell-group class="van-sku-messages"> <cell-group class="van-sku-messages">
<template v-for="(message, index) in internalMessages"> <template v-for="(message, index) in internalMessages">
<template v-if="message.type === 'image'"></template> <template v-if="message.type === 'image'" />
<field v-else-if="message.multiple == '1'" <field
v-else-if="message.multiple == '1'"
:key="`${goodsId}-${index}`" :key="`${goodsId}-${index}`"
:required="message.required == '1'" :required="message.required == '1'"
:label="message.name" :label="message.name"
:placeholder="getPlaceholder('textarea')" :placeholder="getPlaceholder('textarea')"
type="textarea" type="textarea"
v-model="messageValues[index]"> v-model="messageValues[index]"
</field> />
<field v-else <field
v-else
:key="`${goodsId}-${index}`" :key="`${goodsId}-${index}`"
:required="message.required == '1'" :required="message.required == '1'"
:label="message.name" :label="message.name"
:placeholder="getPlaceholder(message.type)" :placeholder="getPlaceholder(message.type)"
:type="getType(message)" :type="getType(message)"
v-model="messageValues[index]"> v-model="messageValues[index]"
</field> />
</template> </template>
</cell-group> </cell-group>
</template> </template>

View File

@ -2,7 +2,7 @@
<div class="van-sku-row"> <div class="van-sku-row">
<div class="van-sku-row__title">{{ skuRow.k }}</div> <div class="van-sku-row__title">{{ skuRow.k }}</div>
<div class="van-sku-row__items"> <div class="van-sku-row__items">
<slot></slot> <slot />
</div> </div>
</div> </div>
</template> </template>

View File

@ -1,5 +1,6 @@
<template> <template>
<span v-if="isChoosable" <span
v-if="isChoosable"
@click="onSkuSelected" @click="onSkuSelected"
class="van-sku-row__item" class="van-sku-row__item"
:class="{ 'van-sku-row__item--active': isChoosed }"> :class="{ 'van-sku-row__item--active': isChoosed }">

View File

@ -7,9 +7,9 @@
v-model="currentNum" v-model="currentNum"
:min="1" :min="1"
:max="stepperLimit" :max="stepperLimit"
:disableInput="disableStepperInput" :disable-input="disableStepperInput"
@overlimit="handleOverLimit"> @overlimit="handleOverLimit"
</stepper> />
</div> </div>
<div v-if="!hideStock" class="van-sku__stock">{{ $t('remain', stock) }}</div> <div v-if="!hideStock" class="van-sku__stock">{{ $t('remain', stock) }}</div>
<div v-if="quota > 0" class="van-sku__quota">{{ $t('quota', quota) }}</div> <div v-if="quota > 0" class="van-sku__quota">{{ $t('quota', quota) }}</div>

View File

@ -1,69 +1,71 @@
<template> <template>
<popup v-model="show" v-if="!isSkuEmpty" position="bottom" lockOnScroll preventScroll> <popup v-model="show" v-if="!isSkuEmpty" position="bottom" lock-on-scroll prevent-scroll>
<div class="van-sku-container"> <div class="van-sku-container">
<div class="van-sku-layout"> <div class="van-sku-layout">
<slot name="sku-header" :skuEventBus="skuEventBus" :selectedSku="selectedSku" :selectedSkuComb="selectedSkuComb"> <slot name="sku-header" :skuEventBus="skuEventBus" :selectedSku="selectedSku" :selectedSkuComb="selectedSkuComb">
<sku-header <sku-header
:skuEventBus="skuEventBus" :sku-event-bus="skuEventBus"
:selectedSku="selectedSku" :selected-sku="selectedSku"
:selectedSkuComb="selectedSkuComb" :selected-sku-comb="selectedSkuComb"
:goods="goods" :goods="goods"
:sku="sku"> :sku="sku"
</sku-header> />
</slot> </slot>
<div class="van-sku-body scroller" :style="bodyStyle"> <div class="van-sku-body scroller" :style="bodyStyle">
<slot name="sku-group" :selectedSku="selectedSku" :skuEventBus="skuEventBus"> <slot name="sku-group" :selectedSku="selectedSku" :skuEventBus="skuEventBus">
<div v-if="hasSku" class="van-sku-group-container van-hairline--bottom"> <div v-if="hasSku" class="van-sku-group-container van-hairline--bottom">
<div v-for="(skuTreeItem, index) in skuTree" <div
v-for="(skuTreeItem, index) in skuTree"
class="van-sku-row-group" class="van-sku-row-group"
:key="index"> :key="index">
<sku-row <sku-row
:skuEventBus="skuEventBus" :sku-event-bus="skuEventBus"
:skuRow="skuTreeItem"> :sku-row="skuTreeItem"
>
<sku-row-item <sku-row-item
v-for="(skuValue, index) in skuTreeItem.v" v-for="(skuValue, index) in skuTreeItem.v"
:key="index" :key="index"
:skuKeyStr="skuTreeItem.k_s" :sku-key-str="skuTreeItem.k_s"
:skuValue="skuValue" :sku-value="skuValue"
:skuEventBus="skuEventBus" :sku-event-bus="skuEventBus"
:selectedSku="selectedSku" :selected-sku="selectedSku"
:skuList="sku.list"> :sku-list="sku.list"
</sku-row-item> />
</sku-row> </sku-row>
</div> </div>
</div> </div>
</slot> </slot>
<slot name="extra-sku-group" :skuEventBus="skuEventBus"></slot> <slot name="extra-sku-group" :skuEventBus="skuEventBus"/>
<slot name="sku-stepper" :skuEventBus="skuEventBus" :selectedSku="selectedSku" :selectedSkuComb="selectedSkuComb" :selectedNum="selectedNum"> <slot name="sku-stepper" :skuEventBus="skuEventBus" :selectedSku="selectedSku" :selectedSkuComb="selectedSkuComb" :selectedNum="selectedNum">
<sku-stepper <sku-stepper
ref="skuStepper" ref="skuStepper"
:skuEventBus="skuEventBus" :sku-event-bus="skuEventBus"
:selectedSku="selectedSku" :selected-sku="selectedSku"
:selectedSkuComb="selectedSkuComb" :selected-sku-comb="selectedSkuComb"
:selectedNum="selectedNum" :selected-num="selectedNum"
:stepperTitle="stepperTitle" :stepper-title="stepperTitle"
:skuStockNum="sku.stock_num" :sku-stock-num="sku.stock_num"
:quota="quota" :quota="quota"
:quotaUsed="quotaUsed" :quota-used="quotaUsed"
:disableStepperInput="disableStepperInput" :disable-stepper-input="disableStepperInput"
:hideStock="hideStock"> :hide-stock="hideStock"
</sku-stepper> />
</slot> </slot>
<slot name="sku-messages"> <slot name="sku-messages">
<sku-messages <sku-messages
ref="skuMessages" ref="skuMessages"
:goodsId="goodsId" :goods-id="goodsId"
:messagePlaceholderMap="messagePlaceholderMap" :message-placeholder-map="messagePlaceholderMap"
:messages="sku.messages"> :messages="sku.messages"
</sku-messages> />
</slot> </slot>
</div> </div>
<slot name="sku-actions" :skuEventBus="skuEventBus"> <slot name="sku-actions" :skuEventBus="skuEventBus">
<sku-actions <sku-actions
:skuEventBus="skuEventBus" :sku-event-bus="skuEventBus"
:buyText="buyText" :buy-text="buyText"
:showAddCartBtn="showAddCartBtn"> :show-add-cart-btn="showAddCartBtn"
</sku-actions> />
</slot> </slot>
</div> </div>
</div> </div>
@ -71,6 +73,7 @@
</template> </template>
<script> <script>
/* eslint-disable camelcase */
import Vue from 'vue'; import Vue from 'vue';
import Popup from '../../popup'; import Popup from '../../popup';
import Toast from '../../toast'; import Toast from '../../toast';
@ -80,7 +83,11 @@ import SkuRowItem from '../components/SkuRowItem';
import SkuStepper from '../components/SkuStepper'; import SkuStepper from '../components/SkuStepper';
import SkuMessages from '../components/SkuMessages'; import SkuMessages from '../components/SkuMessages';
import SkuActions from '../components/SkuActions'; import SkuActions from '../components/SkuActions';
import { isAllSelected, getSkuComb, getSelectedSkuValues } from '../utils/skuHelper'; import {
isAllSelected,
getSkuComb,
getSelectedSkuValues
} from '../utils/skuHelper';
import { LIMIT_TYPE } from '../constants'; import { LIMIT_TYPE } from '../constants';
import { create } from '../../utils'; import { create } from '../../utils';
@ -147,7 +154,10 @@ export default create({
show(val) { show(val) {
this.$emit('input', val); this.$emit('input', val);
if (!val) { if (!val) {
const selectedSkuValues = getSelectedSkuValues(this.sku.tree, this.selectedSku); const selectedSkuValues = getSelectedSkuValues(
this.sku.tree,
this.selectedSku
);
this.$emit('sku-close', { this.$emit('sku-close', {
selectedSkuValues, selectedSkuValues,
@ -200,7 +210,7 @@ export default create({
return { return {
id: this.sku.collection_id, id: this.sku.collection_id,
price: Math.round(this.sku.price * 100), price: Math.round(this.sku.price * 100),
'stock_num': this.sku.stock_num stock_num: this.sku.stock_num
}; };
} else if (this.isSkuCombSelected) { } else if (this.isSkuCombSelected) {
return getSkuComb(this.sku.list, this.selectedSku); return getSkuComb(this.sku.list, this.selectedSku);
@ -231,7 +241,7 @@ export default create({
methods: { methods: {
resetSelectedSku(skuTree) { resetSelectedSku(skuTree) {
this.selectedSku = {}; this.selectedSku = {};
skuTree.forEach((item) => { skuTree.forEach(item => {
// sku // sku
if (item.v.length === 1) { if (item.v.length === 1) {
this.selectedSku[item.k_s] = item.v[0].id; this.selectedSku[item.k_s] = item.v[0].id;
@ -241,9 +251,7 @@ export default create({
}); });
}, },
getSkuMessages() { getSkuMessages() {
return this.$refs.skuMessages return this.$refs.skuMessages ? this.$refs.skuMessages.getMessages() : {};
? this.$refs.skuMessages.getMessages()
: {};
}, },
getSkuCartMessages() { getSkuCartMessages() {
return this.$refs.skuMessages return this.$refs.skuMessages
@ -273,9 +281,10 @@ export default create({
}, },
handleSkuSelected(skuValue) { handleSkuSelected(skuValue) {
// sku // sku
this.selectedSku = this.selectedSku[skuValue.skuKeyStr] === skuValue.id this.selectedSku =
? { ...this.selectedSku, [skuValue.skuKeyStr]: '' } this.selectedSku[skuValue.skuKeyStr] === skuValue.id
: { ...this.selectedSku, [skuValue.skuKeyStr]: skuValue.id }; ? { ...this.selectedSku, [skuValue.skuKeyStr]: '' }
: { ...this.selectedSku, [skuValue.skuKeyStr]: skuValue.id };
this.$emit('sku-selected', { this.$emit('sku-selected', {
skuValue, skuValue,

View File

@ -5,7 +5,7 @@
<icon v-else name="checked" :style="{ color: $parent.activeColor }" /> <icon v-else name="checked" :style="{ color: $parent.activeColor }" />
</div> </div>
<div class="van-step__title" :style="titleStyle"> <div class="van-step__title" :style="titleStyle">
<slot></slot> <slot />
</div> </div>
<div class="van-step__line" /> <div class="van-step__line" />
</div> </div>

View File

@ -4,8 +4,7 @@
class="van-stepper__stepper van-stepper__minus" class="van-stepper__stepper van-stepper__minus"
:class="{ 'van-stepper__minus--disabled': isMinusDisabled }" :class="{ 'van-stepper__minus--disabled': isMinusDisabled }"
@click="onChange('minus')" @click="onChange('minus')"
> />
</button>
<input <input
type="number" type="number"
class="van-stepper__input" class="van-stepper__input"
@ -17,8 +16,7 @@
class="van-stepper__stepper van-stepper__plus" class="van-stepper__stepper van-stepper__plus"
:class="{ 'van-stepper__plus--disabled': isPlusDisabled }" :class="{ 'van-stepper__plus--disabled': isPlusDisabled }"
@click="onChange('plus')" @click="onChange('plus')"
> />
</button>
</div> </div>
</template> </template>

View File

@ -13,7 +13,7 @@
<slot name="message-extra" /> <slot name="message-extra" />
</div> </div>
<div class="van-steps__items" :class="{ 'van-steps__items--alone': !title && !description }"> <div class="van-steps__items" :class="{ 'van-steps__items--alone': !title && !description }">
<slot></slot> <slot />
</div> </div>
</div> </div>
</template> </template>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="van-swipe-item" :style="style"> <div class="van-swipe-item" :style="style">
<slot></slot> <slot />
</div> </div>
</template> </template>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="van-swipe"> <div class="van-swipe">
<div <div
v-if="count > 1" v-if="count > 1"
:style="trackStyle" :style="trackStyle"
class="van-swipe__track" class="van-swipe__track"
@ -10,15 +10,15 @@
@touchcancel="onTouchEnd" @touchcancel="onTouchEnd"
@transitionend="$emit('change', activeIndicator)" @transitionend="$emit('change', activeIndicator)"
> >
<slot></slot> <slot />
</div> </div>
<div v-else class="van-swipe__track"> <div v-else class="van-swipe__track">
<slot></slot> <slot />
</div> </div>
<div class="van-swipe__indicators" v-if="showIndicators && count > 1"> <div class="van-swipe__indicators" v-if="showIndicators && count > 1">
<i v-for="index in count" :class="{ 'van-swipe__indicator--active': index - 1 === activeIndicator }" /> <i v-for="index in count" :class="{ 'van-swipe__indicator--active': index - 1 === activeIndicator }" />
</div> </div>
</div> </div>
</template> </template>
<script> <script>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="van-tab__pane" :class="{ 'van-tab__pane--select': index === parentGroup.curActive }"> <div class="van-tab__pane" :class="{ 'van-tab__pane--select': index === parentGroup.curActive }">
<slot></slot> <slot />
</div> </div>
</template> </template>

View File

@ -7,7 +7,7 @@
<div v-if="info" class="van-icon__info">{{ info }}</div> <div v-if="info" class="van-icon__info">{{ info }}</div>
</div> </div>
<div class="van-tabbar-item__text"> <div class="van-tabbar-item__text">
<slot :active="active"></slot> <slot :active="active"/>
</div> </div>
</div> </div>
</template> </template>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="van-tabbar van-hairline--top-bottom" :class="{ 'van-tabbar--fixed': fixed }"> <div class="van-tabbar van-hairline--top-bottom" :class="{ 'van-tabbar--fixed': fixed }">
<slot></slot> <slot />
</div> </div>
</template> </template>

View File

@ -1,9 +1,12 @@
<template> <template>
<div class="van-tabs" :class="[`van-tabs--${type}`]"> <div class="van-tabs" :class="[`van-tabs--${type}`]">
<div class="van-tabs__wrap" :class="[`van-tabs__wrap--${position}`, { <div
'van-tabs--scrollable': scrollable, class="van-tabs__wrap"
'van-hairline--top-bottom': type === 'line' :class="[`van-tabs__wrap--${position}`, {
}]"> 'van-tabs--scrollable': scrollable,
'van-hairline--top-bottom': type === 'line'
}]"
>
<div class="van-tabs__nav" :class="`van-tabs__nav--${type}`" ref="nav"> <div class="van-tabs__nav" :class="`van-tabs__nav--${type}`" ref="nav">
<div v-if="type === 'line'" class="van-tabs__nav-bar" :style="navBarStyle" /> <div v-if="type === 'line'" class="van-tabs__nav-bar" :style="navBarStyle" />
<div <div
@ -22,7 +25,7 @@
</div> </div>
</div> </div>
<div class="van-tabs__content"> <div class="van-tabs__content">
<slot></slot> <slot />
</div> </div>
</div> </div>
</template> </template>

Some files were not shown because too many files have changed in this diff Show More