优化drawer组件的动画逻辑

master
yutent 2023-08-11 13:48:47 +08:00
parent c3cf60e656
commit 9cacff73d2
1 changed files with 8 additions and 4 deletions

View File

@ -6,6 +6,8 @@
import { css, html, Component, nextTick, styleMap } from 'wkit'
import '../icon/index.js'
const ANIMATION = {
left: {
custom: [
@ -36,7 +38,7 @@ const ANIMATION = {
class Drawer extends Component {
static animation = {}
static props = {
title: '',
title: 'str!',
from: 'right',
visible: {
type: Boolean,
@ -46,8 +48,8 @@ class Drawer extends Component {
this.$refs.drawer.$animate(!v)
}
},
width: '',
height: '',
width: 'str!',
height: 'str!',
maskClose: false
}
@ -129,7 +131,9 @@ class Drawer extends Component {
]
closeDrawer() {
this.$emit('close')
this.visible = false
this.$emit('input', { value: false })
this.$emit('close', { value: false })
}
mounted() {