mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-11-27 04:09:51 +08:00
refactor(alert): support vue3
This commit is contained in:
parent
728ebc5c92
commit
c4b9ad5401
@ -29,5 +29,5 @@ no-icon
|
||||
## Events
|
||||
|Name|Parameters|Description|
|
||||
|-|-|-|
|
||||
|after-hide|`()`||
|
||||
|close|`()`||
|
||||
|after-leave|`()`|When close transition is done|
|
||||
|leave|`()`|When you click close.|
|
@ -30,5 +30,5 @@ no-icon
|
||||
## Events
|
||||
|名称|参数|说明|
|
||||
|-|-|-|
|
||||
|after-hide|`()`||
|
||||
|close|`()`||
|
||||
|after-leave|`()`|关闭动画结束触发|
|
||||
|leave|`()`|点击关闭出发|
|
@ -69,19 +69,28 @@
|
||||
|
||||
<script>
|
||||
import NIcon from '../../icon'
|
||||
import mdCheckmarkCircle from '../../_icons/md-checkmark-circle'
|
||||
import mdAlert from '../../_icons/md-alert'
|
||||
import mdInformationCircle from '../../_icons/md-information-circle'
|
||||
import mdCloseCircle from '../../_icons/md-close-circle'
|
||||
import mdClose from '../../_icons/md-close'
|
||||
import FadeInHeightExpandTransition from '../../_transition/FadeInHeightExpandTransition'
|
||||
import withapp from '../../_mixins/withapp'
|
||||
import themeable from '../../_mixins/themeable'
|
||||
import usecssr from '../../_mixins/usecssr'
|
||||
import styles from './styles'
|
||||
|
||||
// icons
|
||||
import mdCheckmarkCircle from '../../_icons/md-checkmark-circle'
|
||||
import mdAlert from '../../_icons/md-alert'
|
||||
import mdInformationCircle from '../../_icons/md-information-circle'
|
||||
import mdCloseCircle from '../../_icons/md-close-circle'
|
||||
import mdClose from '../../_icons/md-close'
|
||||
|
||||
export default {
|
||||
name: 'Alert',
|
||||
emits: [
|
||||
'leave',
|
||||
'after-leave',
|
||||
// legacy
|
||||
'close',
|
||||
'after-hide'
|
||||
],
|
||||
components: {
|
||||
NIcon,
|
||||
mdCheckmarkCircle,
|
||||
@ -134,8 +143,10 @@ export default {
|
||||
this.visible = true
|
||||
},
|
||||
close () {
|
||||
this.$emit('close')
|
||||
this.$emit('leave')
|
||||
this.visible = false
|
||||
// legacy
|
||||
this.$emit('close')
|
||||
},
|
||||
handleCloseClick () {
|
||||
Promise
|
||||
@ -146,6 +157,8 @@ export default {
|
||||
})
|
||||
},
|
||||
handleAfterLeave () {
|
||||
this.$emit('after-leave')
|
||||
// legacy
|
||||
this.$emit('after-hide')
|
||||
}
|
||||
}
|
||||
|
9
vue3.md
9
vue3.md
@ -4,9 +4,8 @@ zindexable
|
||||
placeable 进行了大调整
|
||||
|
||||
- [ ] Form
|
||||
- [ ] Upload
|
||||
- [ ] affix
|
||||
- [ ] alert
|
||||
- [x] alert
|
||||
- [ ] anchor
|
||||
- [ ] auto-complete
|
||||
- [ ] avatar
|
||||
@ -78,7 +77,9 @@ placeable 进行了大调整
|
||||
- [x] time
|
||||
- [ ] time-picker
|
||||
- [ ] timeline
|
||||
- [ ] tooltip
|
||||
- [x] tooltip
|
||||
- ref
|
||||
- [ ] transfer
|
||||
- [ ] tree
|
||||
- [x] typography
|
||||
- [x] typography
|
||||
- [ ] upload
|
Loading…
Reference in New Issue
Block a user