feat(Popup): add closeable prop (#4362)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { createNamespace, isDef } from '../utils';
|
||||
import { PopupMixin } from '../mixins/popup';
|
||||
import Icon from '../icon';
|
||||
|
||||
const [createComponent, bem] = createNamespace('popup');
|
||||
|
||||
@@ -9,6 +10,7 @@ export default createComponent({
|
||||
props: {
|
||||
round: Boolean,
|
||||
duration: Number,
|
||||
closeable: Boolean,
|
||||
transition: String,
|
||||
position: {
|
||||
type: String,
|
||||
@@ -61,6 +63,9 @@ export default createComponent({
|
||||
onClick={this.onClick}
|
||||
>
|
||||
{this.slots()}
|
||||
{this.closeable && (
|
||||
<Icon name="cross" class={bem('close-icon')} onClick={this.close} />
|
||||
)}
|
||||
</div>
|
||||
</transition>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user