feat(Popup): add closeable prop (#4362)

This commit is contained in:
neverland
2019-09-04 17:58:34 +08:00
committed by GitHub
parent 0bd3997373
commit e64beee5b0
7 changed files with 92 additions and 115 deletions
+5
View File
@@ -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>
);