init
This commit is contained in:
37
fuintUniapp/components/popup/index.js
Normal file
37
fuintUniapp/components/popup/index.js
Normal file
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
|
||||
// 弹出方向
|
||||
type: {
|
||||
type: String,
|
||||
value: 'center'
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleMaskClick: function() {
|
||||
this.triggerEvent('click-overlay', {});
|
||||
|
||||
if (!this.data.closeOnClickOverlay) {
|
||||
return;
|
||||
}
|
||||
this.triggerEvent('close', {});
|
||||
}
|
||||
}
|
||||
});
|
||||
6
fuintUniapp/components/popup/index.json
Normal file
6
fuintUniapp/components/popup/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"pop-manager": "../pop-manager/index"
|
||||
}
|
||||
}
|
||||
8
fuintUniapp/components/popup/index.wxml
Normal file
8
fuintUniapp/components/popup/index.wxml
Normal file
@@ -0,0 +1,8 @@
|
||||
<pop-manager
|
||||
show="{{ show }}"
|
||||
type="{{ type }}"
|
||||
show-overlay="{{ overlay }}"
|
||||
bindclickmask="handleMaskClick"
|
||||
>
|
||||
<slot></slot>
|
||||
</pop-manager>
|
||||
Reference in New Issue
Block a user