[improvement] update eslint rules (#2089)

This commit is contained in:
neverland
2018-11-15 15:30:17 +08:00
committed by GitHub
parent 0860901ec1
commit e14b43e66a
129 changed files with 1874 additions and 456 deletions

View File

@@ -5,12 +5,25 @@
</demo-block>
<demo-block :title="$t('disabled')">
<van-checkbox :value="false" disabled>{{ $t('checkbox') }}</van-checkbox>
<van-checkbox :value="true" disabled>{{ $t('checkbox') }}</van-checkbox>
<van-checkbox
:value="false"
disabled
>
{{ $t('checkbox') }}
</van-checkbox>
<van-checkbox
:value="true"
disabled
>
{{ $t('checkbox') }}
</van-checkbox>
</demo-block>
<demo-block :title="$t('customColor')">
<van-checkbox v-model="checkbox2" checked-color="#4b0">
<van-checkbox
v-model="checkbox2"
checked-color="#4b0"
>
{{ $t('customColor') }}
</van-checkbox>
</demo-block>
@@ -39,7 +52,10 @@
</demo-block>
<demo-block :title="$t('title4')">
<van-checkbox-group v-model="result2" :max="2">
<van-checkbox-group
v-model="result2"
:max="2"
>
<van-checkbox
v-for="(item, index) in list"
:key="index"
@@ -60,7 +76,10 @@
:title="$t('checkbox') + item"
@click="toggle(index)"
>
<van-checkbox ref="checkboxes" :name="item" />
<van-checkbox
ref="checkboxes"
:name="item"
/>
</van-cell>
</van-cell-group>
</van-checkbox-group>

View File

@@ -1,11 +1,24 @@
<template>
<div :class="b()">
<div :class="[b('icon', [shape, { disabled: isDisabled, checked }])]" @click="toggle">
<slot name="icon" :checked="checked">
<icon name="success" :style="iconStyle" />
<div
:class="[b('icon', [shape, { disabled: isDisabled, checked }])]"
@click="toggle"
>
<slot
name="icon"
:checked="checked"
>
<icon
name="success"
:style="iconStyle"
/>
</slot>
</div>
<span v-if="$slots.default" :class="b('label', labelPosition)" @click="toggle('label')">
<span
v-if="$slots.default"
:class="b('label', labelPosition)"
@click="toggle('label')"
>
<slot />
</span>
</div>

View File

@@ -16,13 +16,17 @@ exports[`renders demo correctly 1`] = `
<i class="van-icon van-icon-success" style="color:undefined;font-size:undefined;">
<!---->
</i>
</div> <span class="van-checkbox__label">复选框</span></div>
</div> <span class="van-checkbox__label">
复选框
</span></div>
<div class="van-checkbox">
<div class="van-checkbox__icon van-checkbox__icon--round van-checkbox__icon--disabled van-checkbox__icon--checked">
<i class="van-icon van-icon-success" style="color:undefined;font-size:undefined;">
<!---->
</i>
</div> <span class="van-checkbox__label">复选框</span></div>
</div> <span class="van-checkbox__label">
复选框
</span></div>
</div>
<div>
<div class="van-checkbox">