[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,23 @@
</demo-block>
<demo-block :title="$t('title2')">
<van-progress inactive :percentage="50" />
<van-progress
inactive
:percentage="50"
/>
</demo-block>
<demo-block :title="$t('title3')">
<van-progress :pivot-text="$t('orange')" color="#f2826a" :percentage="25" />
<van-progress :pivot-text="$t('red')" color="#f44" :percentage="50" />
<van-progress
color="#f2826a"
:percentage="25"
:pivot-text="$t('orange')"
/>
<van-progress
color="#f44"
:percentage="50"
:pivot-text="$t('red')"
/>
<van-progress
:percentage="75"
:pivot-text="$t('purple')"

View File

@@ -1,7 +1,17 @@
<template>
<div :class="b()">
<span :class="b('portion', { 'with-pivot': showPivot && text })" :style="portionStyle">
<span v-if="showPivot && text" ref="pivot" :style="pivotStyle" :class="b('pivot')">{{ text }}</span>
<span
:class="b('portion', { 'with-pivot': showPivot && text })"
:style="portionStyle"
>
<span
v-if="showPivot && text"
ref="pivot"
:style="pivotStyle"
:class="b('pivot')"
>
{{ text }}
</span>
</span>
</div>
</template>

View File

@@ -3,19 +3,29 @@
exports[`renders demo correctly 1`] = `
<div>
<div>
<div class="van-progress"><span class="van-progress__portion van-progress__portion--with-pivot" style="width:0px;background:#1989fa;"><span class="van-progress__pivot" style="color:#fff;background:#1989fa;">50%</span></span>
<div class="van-progress"><span class="van-progress__portion van-progress__portion--with-pivot" style="width:0px;background:#1989fa;"><span class="van-progress__pivot" style="color:#fff;background:#1989fa;">
50%
</span></span>
</div>
</div>
<div>
<div class="van-progress"><span class="van-progress__portion van-progress__portion--with-pivot" style="width:0px;background:#cacaca;"><span class="van-progress__pivot" style="color:#fff;background:#cacaca;">50%</span></span>
<div class="van-progress"><span class="van-progress__portion van-progress__portion--with-pivot" style="width:0px;background:#cacaca;"><span class="van-progress__pivot" style="color:#fff;background:#cacaca;">
50%
</span></span>
</div>
</div>
<div>
<div class="van-progress"><span class="van-progress__portion van-progress__portion--with-pivot" style="width:0px;background:#f2826a;"><span class="van-progress__pivot" style="color:#fff;background:#f2826a;">橙色</span></span>
<div class="van-progress"><span class="van-progress__portion van-progress__portion--with-pivot" style="width:0px;background:#f2826a;"><span class="van-progress__pivot" style="color:#fff;background:#f2826a;">
橙色
</span></span>
</div>
<div class="van-progress"><span class="van-progress__portion van-progress__portion--with-pivot" style="width:0px;background:#f44;"><span class="van-progress__pivot" style="color:#fff;background:#f44;">红色</span></span>
<div class="van-progress"><span class="van-progress__portion van-progress__portion--with-pivot" style="width:0px;background:#f44;"><span class="van-progress__pivot" style="color:#fff;background:#f44;">
红色
</span></span>
</div>
<div class="van-progress"><span class="van-progress__portion van-progress__portion--with-pivot" style="width:0px;background:linear-gradient(to right, #be99ff, #7232dd);"><span class="van-progress__pivot" style="color:#fff;background:#7232dd;">紫色</span></span>
<div class="van-progress"><span class="van-progress__portion van-progress__portion--with-pivot" style="width:0px;background:linear-gradient(to right, #be99ff, #7232dd);"><span class="van-progress__pivot" style="color:#fff;background:#7232dd;">
紫色
</span></span>
</div>
</div>
</div>

View File

@@ -3,6 +3,8 @@
exports[`calc width 1`] = `<div class="van-progress"><span class="van-progress__portion" style="width: 0px; background: rgb(25, 137, 250);"><!----></span></div>`;
exports[`calc width 2`] = `
<div class="van-progress"><span class="van-progress__portion van-progress__portion--with-pivot" style="width: 0px; background: rgb(25, 137, 250);"><span class="van-progress__pivot" style="color: rgb(255, 255, 255); background: rgb(25, 137, 250);">test</span></span>
<div class="van-progress"><span class="van-progress__portion van-progress__portion--with-pivot" style="width: 0px; background: rgb(25, 137, 250);"><span class="van-progress__pivot" style="color: rgb(255, 255, 255); background: rgb(25, 137, 250);">
test
</span></span>
</div>
`;