Skip to content

Commit

Permalink
Alert add prop: fade
Browse files Browse the repository at this point in the history
  • Loading branch information
icarusion committed Sep 14, 2021
1 parent 02330ed commit 70f7707
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 9 additions & 3 deletions examples/routers/alert.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div>
<Alert>
<Button @click="show = !show">toggle show</Button>
<Alert v-if="show" :fade="false">
An info prompt
<template slot="desc">Content of prompt. Content of prompt. Content of prompt. Content of prompt. </template>
</Alert>
Expand Down Expand Up @@ -56,7 +57,7 @@
A success prompt
<span slot="desc">Content of prompt. Content of prompt. Content of prompt. Content of prompt. </span>
</Alert>
<Alert type="warning" closable>
<Alert type="warning" closable :fade="false">
Custom closing content
<span slot="close">No longer prompt</span>
</Alert>
Expand All @@ -65,6 +66,11 @@
<script>
import { Alert, Icon } from 'iview';
export default {
components: { Alert, Icon }
components: { Alert, Icon },
data () {
return {
show: true
}
}
}
</script>
6 changes: 5 additions & 1 deletion src/components/alert/alert.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<transition name="fade">
<transition :name="fade ? 'fade' : ''">
<div v-if="!closed" :class="wrapClasses">
<span :class="iconClasses" v-if="showIcon">
<slot name="icon">
Expand Down Expand Up @@ -43,6 +43,10 @@
banner: {
type: Boolean,
default: false
},
fade: {
type: Boolean,
default: true
}
},
data () {
Expand Down

0 comments on commit 70f7707

Please sign in to comment.