Commit 18cffe186a1d106e693253e66c5e66be2b92cb57
Committed by
GitHub

Merge pull request #5485 from pyyzcwg2833/2.0
修复notification的进入transition失效 & loading-bar新增duration属性
Showing
3 changed files
with
11 additions
and
2 deletions
Show diff stats
src/components/base/notification/notice.vue
1 | <template> | 1 | <template> |
2 | - <transition :name="transitionName" @enter="handleEnter" @leave="handleLeave"> | 2 | + <transition :name="transitionName" @enter="handleEnter" @leave="handleLeave" appear> |
3 | <div :class="classes" :style="styles"> | 3 | <div :class="classes" :style="styles"> |
4 | <template v-if="type === 'notice'"> | 4 | <template v-if="type === 'notice'"> |
5 | <div :class="contentClasses" ref="content" v-html="content"></div> | 5 | <div :class="contentClasses" ref="content" v-html="content"></div> |
src/components/loading-bar/index.js
@@ -2,6 +2,7 @@ import LoadingBar from './loading-bar'; | @@ -2,6 +2,7 @@ import LoadingBar from './loading-bar'; | ||
2 | 2 | ||
3 | let loadingBarInstance; | 3 | let loadingBarInstance; |
4 | let color = 'primary'; | 4 | let color = 'primary'; |
5 | +let duration = 800; | ||
5 | let failedColor = 'error'; | 6 | let failedColor = 'error'; |
6 | let height = 2; | 7 | let height = 2; |
7 | let timer; | 8 | let timer; |
@@ -32,7 +33,7 @@ function hide() { | @@ -32,7 +33,7 @@ function hide() { | ||
32 | percent: 0 | 33 | percent: 0 |
33 | }); | 34 | }); |
34 | }, 200); | 35 | }, 200); |
35 | - }, 800); | 36 | + }, duration); |
36 | } | 37 | } |
37 | 38 | ||
38 | function clearTimer() { | 39 | function clearTimer() { |
@@ -96,6 +97,9 @@ export default { | @@ -96,6 +97,9 @@ export default { | ||
96 | if (options.color) { | 97 | if (options.color) { |
97 | color = options.color; | 98 | color = options.color; |
98 | } | 99 | } |
100 | + if (options.duration) { | ||
101 | + duration = options.duration; | ||
102 | + } | ||
99 | if (options.failedColor) { | 103 | if (options.failedColor) { |
100 | failedColor = options.failedColor; | 104 | failedColor = options.failedColor; |
101 | } | 105 | } |
types/loading-bar.d.ts
@@ -42,6 +42,11 @@ export declare interface LoadingBarConfig { | @@ -42,6 +42,11 @@ export declare interface LoadingBarConfig { | ||
42 | */ | 42 | */ |
43 | color?: string; | 43 | color?: string; |
44 | /** | 44 | /** |
45 | + * 自动消失的延时, 默认为800ms | ||
46 | + * @default 800 | ||
47 | + */ | ||
48 | + duration?: number; | ||
49 | + /** | ||
45 | * 失败时的进度条颜色,默认为 iView 主色 | 50 | * 失败时的进度条颜色,默认为 iView 主色 |
46 | * @default error | 51 | * @default error |
47 | */ | 52 | */ |