first commit
This commit is contained in:
26
miniprogram/@vant/weapp/dist/overlay/index.js
vendored
Normal file
26
miniprogram/@vant/weapp/dist/overlay/index.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
VantComponent({
|
||||
props: {
|
||||
show: Boolean,
|
||||
customStyle: String,
|
||||
duration: {
|
||||
type: null,
|
||||
value: 300,
|
||||
},
|
||||
zIndex: {
|
||||
type: Number,
|
||||
value: 1,
|
||||
},
|
||||
lockScroll: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onClick() {
|
||||
this.$emit('click');
|
||||
},
|
||||
// for prevent touchmove
|
||||
noop() { },
|
||||
},
|
||||
});
|
||||
6
miniprogram/@vant/weapp/dist/overlay/index.json
vendored
Normal file
6
miniprogram/@vant/weapp/dist/overlay/index.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-transition": "../transition/index"
|
||||
}
|
||||
}
|
||||
21
miniprogram/@vant/weapp/dist/overlay/index.wxml
vendored
Normal file
21
miniprogram/@vant/weapp/dist/overlay/index.wxml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<van-transition
|
||||
wx:if="{{ lockScroll }}"
|
||||
show="{{ show }}"
|
||||
custom-class="van-overlay"
|
||||
custom-style="z-index: {{ zIndex }}; {{ customStyle }}"
|
||||
duration="{{ duration }}"
|
||||
bind:tap="onClick"
|
||||
catch:touchmove="noop"
|
||||
>
|
||||
<slot></slot>
|
||||
</van-transition>
|
||||
<van-transition
|
||||
wx:else
|
||||
show="{{ show }}"
|
||||
custom-class="van-overlay"
|
||||
custom-style="z-index: {{ zIndex }}; {{ customStyle }}"
|
||||
duration="{{ duration }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<slot></slot>
|
||||
</van-transition>
|
||||
1
miniprogram/@vant/weapp/dist/overlay/index.wxss
vendored
Normal file
1
miniprogram/@vant/weapp/dist/overlay/index.wxss
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@import '../common/index.wxss';.van-overlay{background-color:var(--overlay-background-color,rgba(0,0,0,.7));height:100%;left:0;position:fixed;top:0;width:100%}
|
||||
Reference in New Issue
Block a user