mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2026-07-09 16:11:06 +08:00
Compare commits
9 Commits
cf36c8ebbd
...
f86c1fd1f2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f86c1fd1f2 | ||
|
|
17c96a1827 | ||
|
|
79c50951a5 | ||
|
|
6b9af20525 | ||
|
|
d69ec23b88 | ||
|
|
77c765d451 | ||
|
|
3a4baaff41 | ||
|
|
17b9eadcb0 | ||
|
|
9352b33673 |
8
dist/dropdown-item/index.js
vendored
8
dist/dropdown-item/index.js
vendored
@ -30,12 +30,17 @@ VantComponent({
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
rootPortal: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
data: {
|
||||
transition: true,
|
||||
showPopup: false,
|
||||
showWrapper: false,
|
||||
displayTitle: '',
|
||||
safeAreaTabBar: false,
|
||||
},
|
||||
methods: {
|
||||
rerender() {
|
||||
@ -46,13 +51,14 @@ VantComponent({
|
||||
},
|
||||
updateDataFromParent() {
|
||||
if (this.parent) {
|
||||
const { overlay, duration, activeColor, closeOnClickOverlay, direction, } = this.parent.data;
|
||||
const { overlay, duration, activeColor, closeOnClickOverlay, direction, safeAreaTabBar, } = this.parent.data;
|
||||
this.setData({
|
||||
overlay,
|
||||
duration,
|
||||
activeColor,
|
||||
closeOnClickOverlay,
|
||||
direction,
|
||||
safeAreaTabBar,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
2
dist/dropdown-item/index.wxml
vendored
2
dist/dropdown-item/index.wxml
vendored
@ -12,7 +12,9 @@
|
||||
overlay="{{ overlay }}"
|
||||
position="{{ direction === 'down' ? 'top' : 'bottom' }}"
|
||||
duration="{{ transition ? duration : 0 }}"
|
||||
safe-area-tab-bar="{{ safeAreaTabBar }}"
|
||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||
rootPortal="{{ rootPortal }}"
|
||||
bind:enter="onOpen"
|
||||
bind:leave="onClose"
|
||||
bind:close="toggle"
|
||||
|
||||
4
dist/dropdown-menu/index.js
vendored
4
dist/dropdown-menu/index.js
vendored
@ -32,6 +32,10 @@ VantComponent({
|
||||
value: 'down',
|
||||
observer: 'updateChildrenData',
|
||||
},
|
||||
safeAreaTabBar: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
|
||||
4
dist/icon/index.wxs
vendored
4
dist/icon/index.wxs
vendored
@ -13,6 +13,10 @@ function rootClass(data) {
|
||||
classes.push(data.classPrefix);
|
||||
}
|
||||
|
||||
if (data.classPrefix !== 'van-icon') {
|
||||
classes.push('van-icon')
|
||||
}
|
||||
|
||||
if (isImage(data.name)) {
|
||||
classes.push('van-icon--image');
|
||||
} else if (data.classPrefix != null) {
|
||||
|
||||
4
dist/overlay/index.js
vendored
4
dist/overlay/index.js
vendored
@ -15,6 +15,10 @@ VantComponent({
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
rootPortal: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onClick() {
|
||||
|
||||
28
dist/overlay/index.wxml
vendored
28
dist/overlay/index.wxml
vendored
@ -1,21 +1,7 @@
|
||||
<van-transition
|
||||
wx:if="{{ lockScroll }}"
|
||||
show="{{ show }}"
|
||||
custom-class="van-overlay custom-class"
|
||||
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-class"
|
||||
custom-style="z-index: {{ zIndex }}; {{ customStyle }}"
|
||||
duration="{{ duration }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<slot></slot>
|
||||
</van-transition>
|
||||
<import src="./overlay.wxml" />
|
||||
|
||||
<root-portal wx:if="{{ rootPortal }}">
|
||||
<include src="./overlay.wxml" />
|
||||
</root-portal>
|
||||
|
||||
<include wx:else src="./overlay.wxml" />
|
||||
|
||||
10
dist/overlay/overlay.wxml
vendored
Normal file
10
dist/overlay/overlay.wxml
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
<van-transition
|
||||
show="{{ show }}"
|
||||
custom-class="van-overlay custom-class"
|
||||
custom-style="z-index: {{ zIndex }}; {{ customStyle }}"
|
||||
duration="{{ duration }}"
|
||||
bind:tap="onClick"
|
||||
catch:touchmove="{{ lockScroll ? 'noop' : ''}}"
|
||||
>
|
||||
<slot></slot>
|
||||
</van-transition>
|
||||
4
dist/popup/index.js
vendored
4
dist/popup/index.js
vendored
@ -61,6 +61,10 @@ VantComponent({
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
rootPortal: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.observeClass();
|
||||
|
||||
23
dist/popup/index.wxml
vendored
23
dist/popup/index.wxml
vendored
@ -1,6 +1,8 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
|
||||
<import src="./popup.wxml" />
|
||||
|
||||
<van-overlay
|
||||
wx:if="{{ overlay }}"
|
||||
show="{{ show }}"
|
||||
@ -9,18 +11,11 @@
|
||||
duration="{{ duration }}"
|
||||
bind:click="onClickOverlay"
|
||||
lock-scroll="{{ lockScroll }}"
|
||||
root-portal="{{ rootPortal }}"
|
||||
/>
|
||||
<view
|
||||
wx:if="{{ inited }}"
|
||||
class="custom-class {{ classes }} {{ utils.bem('popup', [position, { round, safe: safeAreaInsetBottom, safeTop: safeAreaInsetTop, safeTabBar: safeAreaTabBar }]) }}"
|
||||
style="{{ computed.popupStyle({ zIndex, currentDuration, display, customStyle }) }}"
|
||||
bind:transitionend="onTransitionEnd"
|
||||
>
|
||||
<slot />
|
||||
<van-icon
|
||||
wx:if="{{ closeable }}"
|
||||
name="{{ closeIcon }}"
|
||||
class="close-icon-class van-popup__close-icon van-popup__close-icon--{{ closeIconPosition }}"
|
||||
bind:tap="onClickCloseIcon"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<root-portal wx:if="{{ rootPortal }}">
|
||||
<include src="./popup.wxml" />
|
||||
</root-portal>
|
||||
|
||||
<include wx:else src="./popup.wxml" />
|
||||
|
||||
2
dist/popup/index.wxss
vendored
2
dist/popup/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-popup{-webkit-overflow-scrolling:touch;animation:ease both;background-color:var(--popup-background-color,#fff);box-sizing:border-box;max-height:100%;overflow-y:auto;position:fixed;transition-timing-function:ease}.van-popup--center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--popup-round-border-radius,16px)}.van-popup--top{left:0;top:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--right{right:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0}.van-popup--left{left:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0}.van-popup--bottom.van-popup--safe{padding-bottom:env(safe-area-inset-bottom)}.van-popup--bottom.van-popup--safeTabBar{bottom:var(--tabbar-height,50px)}.van-popup--safeTop{padding-top:env(safe-area-inset-top)}.van-popup__close-icon{color:var(--popup-close-icon-color,#969799);font-size:var(--popup-close-icon-size,18px);position:absolute;z-index:var(--popup-close-icon-z-index,1)}.van-popup__close-icon--top-left{left:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--top-right{right:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-left{bottom:var(--popup-close-icon-margin,16px);left:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-right{bottom:var(--popup-close-icon-margin,16px);right:var(--popup-close-icon-margin,16px)}.van-popup__close-icon:active{opacity:.6}.van-scale-enter-active,.van-scale-leave-active{transition-property:opacity,transform}.van-scale-enter,.van-scale-leave-to{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-center-enter-active,.van-center-leave-active{transition-property:opacity}.van-center-enter,.van-center-leave-to{opacity:0}.van-bottom-enter-active,.van-bottom-leave-active,.van-left-enter-active,.van-left-leave-active,.van-right-enter-active,.van-right-leave-active,.van-top-enter-active,.van-top-leave-active{transition-property:transform}.van-bottom-enter,.van-bottom-leave-to{transform:translate3d(0,100%,0)}.van-top-enter,.van-top-leave-to{transform:translate3d(0,-100%,0)}.van-left-enter,.van-left-leave-to{transform:translate3d(-100%,-50%,0)}.van-right-enter,.van-right-leave-to{transform:translate3d(100%,-50%,0)}
|
||||
@import '../common/index.wxss';.van-popup{-webkit-overflow-scrolling:touch;animation:ease both;background-color:var(--popup-background-color,#fff);box-sizing:border-box;max-height:100%;overflow-y:auto;position:fixed;transition-timing-function:ease}.van-popup--center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--popup-round-border-radius,16px)}.van-popup--top{left:0;top:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--right{right:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0}.van-popup--left{left:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0}.van-popup--bottom.van-popup--safe{padding-bottom:env(safe-area-inset-bottom)}.van-popup--bottom.van-popup--safeTabBar,.van-popup--top.van-popup--safeTabBar{bottom:var(--tabbar-height,50px)}.van-popup--safeTop{padding-top:env(safe-area-inset-top)}.van-popup__close-icon{color:var(--popup-close-icon-color,#969799);font-size:var(--popup-close-icon-size,18px);position:absolute;z-index:var(--popup-close-icon-z-index,1)}.van-popup__close-icon--top-left{left:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--top-right{right:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-left{bottom:var(--popup-close-icon-margin,16px);left:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-right{bottom:var(--popup-close-icon-margin,16px);right:var(--popup-close-icon-margin,16px)}.van-popup__close-icon:active{opacity:.6}.van-scale-enter-active,.van-scale-leave-active{transition-property:opacity,transform}.van-scale-enter,.van-scale-leave-to{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-center-enter-active,.van-center-leave-active{transition-property:opacity}.van-center-enter,.van-center-leave-to{opacity:0}.van-bottom-enter-active,.van-bottom-leave-active,.van-left-enter-active,.van-left-leave-active,.van-right-enter-active,.van-right-leave-active,.van-top-enter-active,.van-top-leave-active{transition-property:transform}.van-bottom-enter,.van-bottom-leave-to{transform:translate3d(0,100%,0)}.van-top-enter,.van-top-leave-to{transform:translate3d(0,-100%,0)}.van-left-enter,.van-left-leave-to{transform:translate3d(-100%,-50%,0)}.van-right-enter,.van-right-leave-to{transform:translate3d(100%,-50%,0)}
|
||||
14
dist/popup/popup.wxml
vendored
Normal file
14
dist/popup/popup.wxml
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
<view
|
||||
wx:if="{{ inited }}"
|
||||
class="custom-class {{ classes }} {{ utils.bem('popup', [position, { round, safe: safeAreaInsetBottom, safeTop: safeAreaInsetTop, safeTabBar: safeAreaTabBar }]) }}"
|
||||
style="{{ computed.popupStyle({ zIndex, currentDuration, display, customStyle }) }}"
|
||||
bind:transitionend="onTransitionEnd"
|
||||
>
|
||||
<slot />
|
||||
<van-icon
|
||||
wx:if="{{ closeable }}"
|
||||
name="{{ closeIcon }}"
|
||||
class="close-icon-class van-popup__close-icon van-popup__close-icon--{{ closeIconPosition }}"
|
||||
bind:tap="onClickCloseIcon"
|
||||
/>
|
||||
</view>
|
||||
@ -1,4 +1,24 @@
|
||||
# 更新日志
|
||||
### [v1.10.14](https://github.com/youzan/vant-weapp/compare/v1.10.13...v1.10.14)
|
||||
|
||||
`2023-02-27`
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- icon: fix dot when custom icon [#5253](https://github.com/youzan/vant-weapp/issues/5253)
|
||||
|
||||
**Document**
|
||||
|
||||
- add @landluck and @wjw-gavin to core team [#5252](https://github.com/youzan/vant-weapp/issues/5252)
|
||||
|
||||
**Feature**
|
||||
|
||||
- dropdown-item: add root-portal prop support [#5256](https://github.com/youzan/vant-weapp/issues/5256)
|
||||
- dropdown-menu: add safe-area-tab-bar prop support [#5257](https://github.com/youzan/vant-weapp/issues/5257)
|
||||
- overlay: add root-portal prop support [#5255](https://github.com/youzan/vant-weapp/issues/5255)
|
||||
- popup: add root-portal prop support [#5254](https://github.com/youzan/vant-weapp/issues/5254)
|
||||
|
||||
|
||||
### [v1.10.13](https://github.com/youzan/vant-weapp/compare/v1.10.12...v1.10.13)
|
||||
|
||||
`2023-02-13`
|
||||
|
||||
@ -32,12 +32,17 @@ var component_1 = require("../common/component");
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
rootPortal: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
data: {
|
||||
transition: true,
|
||||
showPopup: false,
|
||||
showWrapper: false,
|
||||
displayTitle: '',
|
||||
safeAreaTabBar: false,
|
||||
},
|
||||
methods: {
|
||||
rerender: function () {
|
||||
@ -49,13 +54,14 @@ var component_1 = require("../common/component");
|
||||
},
|
||||
updateDataFromParent: function () {
|
||||
if (this.parent) {
|
||||
var _a = this.parent.data, overlay = _a.overlay, duration = _a.duration, activeColor = _a.activeColor, closeOnClickOverlay = _a.closeOnClickOverlay, direction = _a.direction;
|
||||
var _a = this.parent.data, overlay = _a.overlay, duration = _a.duration, activeColor = _a.activeColor, closeOnClickOverlay = _a.closeOnClickOverlay, direction = _a.direction, safeAreaTabBar = _a.safeAreaTabBar;
|
||||
this.setData({
|
||||
overlay: overlay,
|
||||
duration: duration,
|
||||
activeColor: activeColor,
|
||||
closeOnClickOverlay: closeOnClickOverlay,
|
||||
direction: direction,
|
||||
safeAreaTabBar: safeAreaTabBar,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@ -12,7 +12,9 @@
|
||||
overlay="{{ overlay }}"
|
||||
position="{{ direction === 'down' ? 'top' : 'bottom' }}"
|
||||
duration="{{ transition ? duration : 0 }}"
|
||||
safe-area-tab-bar="{{ safeAreaTabBar }}"
|
||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||
rootPortal="{{ rootPortal }}"
|
||||
bind:enter="onOpen"
|
||||
bind:leave="onClose"
|
||||
bind:close="toggle"
|
||||
|
||||
@ -34,6 +34,10 @@ var ARRAY = [];
|
||||
value: 'down',
|
||||
observer: 'updateChildrenData',
|
||||
},
|
||||
safeAreaTabBar: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
|
||||
@ -13,6 +13,10 @@ function rootClass(data) {
|
||||
classes.push(data.classPrefix);
|
||||
}
|
||||
|
||||
if (data.classPrefix !== 'van-icon') {
|
||||
classes.push('van-icon')
|
||||
}
|
||||
|
||||
if (isImage(data.name)) {
|
||||
classes.push('van-icon--image');
|
||||
} else if (data.classPrefix != null) {
|
||||
|
||||
@ -17,6 +17,10 @@ var component_1 = require("../common/component");
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
rootPortal: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onClick: function () {
|
||||
|
||||
@ -1,21 +1,7 @@
|
||||
<van-transition
|
||||
wx:if="{{ lockScroll }}"
|
||||
show="{{ show }}"
|
||||
custom-class="van-overlay custom-class"
|
||||
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-class"
|
||||
custom-style="z-index: {{ zIndex }}; {{ customStyle }}"
|
||||
duration="{{ duration }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<slot></slot>
|
||||
</van-transition>
|
||||
<import src="./overlay.wxml" />
|
||||
|
||||
<root-portal wx:if="{{ rootPortal }}">
|
||||
<include src="./overlay.wxml" />
|
||||
</root-portal>
|
||||
|
||||
<include wx:else src="./overlay.wxml" />
|
||||
|
||||
10
lib/overlay/overlay.wxml
Normal file
10
lib/overlay/overlay.wxml
Normal file
@ -0,0 +1,10 @@
|
||||
<van-transition
|
||||
show="{{ show }}"
|
||||
custom-class="van-overlay custom-class"
|
||||
custom-style="z-index: {{ zIndex }}; {{ customStyle }}"
|
||||
duration="{{ duration }}"
|
||||
bind:tap="onClick"
|
||||
catch:touchmove="{{ lockScroll ? 'noop' : ''}}"
|
||||
>
|
||||
<slot></slot>
|
||||
</van-transition>
|
||||
@ -63,6 +63,10 @@ var transition_1 = require("../mixins/transition");
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
rootPortal: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
created: function () {
|
||||
this.observeClass();
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
|
||||
<import src="./popup.wxml" />
|
||||
|
||||
<van-overlay
|
||||
wx:if="{{ overlay }}"
|
||||
show="{{ show }}"
|
||||
@ -9,18 +11,11 @@
|
||||
duration="{{ duration }}"
|
||||
bind:click="onClickOverlay"
|
||||
lock-scroll="{{ lockScroll }}"
|
||||
root-portal="{{ rootPortal }}"
|
||||
/>
|
||||
<view
|
||||
wx:if="{{ inited }}"
|
||||
class="custom-class {{ classes }} {{ utils.bem('popup', [position, { round, safe: safeAreaInsetBottom, safeTop: safeAreaInsetTop, safeTabBar: safeAreaTabBar }]) }}"
|
||||
style="{{ computed.popupStyle({ zIndex, currentDuration, display, customStyle }) }}"
|
||||
bind:transitionend="onTransitionEnd"
|
||||
>
|
||||
<slot />
|
||||
<van-icon
|
||||
wx:if="{{ closeable }}"
|
||||
name="{{ closeIcon }}"
|
||||
class="close-icon-class van-popup__close-icon van-popup__close-icon--{{ closeIconPosition }}"
|
||||
bind:tap="onClickCloseIcon"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<root-portal wx:if="{{ rootPortal }}">
|
||||
<include src="./popup.wxml" />
|
||||
</root-portal>
|
||||
|
||||
<include wx:else src="./popup.wxml" />
|
||||
|
||||
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-popup{-webkit-overflow-scrolling:touch;animation:ease both;background-color:var(--popup-background-color,#fff);box-sizing:border-box;max-height:100%;overflow-y:auto;position:fixed;transition-timing-function:ease}.van-popup--center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--popup-round-border-radius,16px)}.van-popup--top{left:0;top:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--right{right:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0}.van-popup--left{left:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0}.van-popup--bottom.van-popup--safe{padding-bottom:env(safe-area-inset-bottom)}.van-popup--bottom.van-popup--safeTabBar{bottom:var(--tabbar-height,50px)}.van-popup--safeTop{padding-top:env(safe-area-inset-top)}.van-popup__close-icon{color:var(--popup-close-icon-color,#969799);font-size:var(--popup-close-icon-size,18px);position:absolute;z-index:var(--popup-close-icon-z-index,1)}.van-popup__close-icon--top-left{left:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--top-right{right:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-left{bottom:var(--popup-close-icon-margin,16px);left:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-right{bottom:var(--popup-close-icon-margin,16px);right:var(--popup-close-icon-margin,16px)}.van-popup__close-icon:active{opacity:.6}.van-scale-enter-active,.van-scale-leave-active{transition-property:opacity,transform}.van-scale-enter,.van-scale-leave-to{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-center-enter-active,.van-center-leave-active{transition-property:opacity}.van-center-enter,.van-center-leave-to{opacity:0}.van-bottom-enter-active,.van-bottom-leave-active,.van-left-enter-active,.van-left-leave-active,.van-right-enter-active,.van-right-leave-active,.van-top-enter-active,.van-top-leave-active{transition-property:transform}.van-bottom-enter,.van-bottom-leave-to{transform:translate3d(0,100%,0)}.van-top-enter,.van-top-leave-to{transform:translate3d(0,-100%,0)}.van-left-enter,.van-left-leave-to{transform:translate3d(-100%,-50%,0)}.van-right-enter,.van-right-leave-to{transform:translate3d(100%,-50%,0)}
|
||||
@import '../common/index.wxss';.van-popup{-webkit-overflow-scrolling:touch;animation:ease both;background-color:var(--popup-background-color,#fff);box-sizing:border-box;max-height:100%;overflow-y:auto;position:fixed;transition-timing-function:ease}.van-popup--center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--popup-round-border-radius,16px)}.van-popup--top{left:0;top:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--right{right:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0}.van-popup--left{left:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0}.van-popup--bottom.van-popup--safe{padding-bottom:env(safe-area-inset-bottom)}.van-popup--bottom.van-popup--safeTabBar,.van-popup--top.van-popup--safeTabBar{bottom:var(--tabbar-height,50px)}.van-popup--safeTop{padding-top:env(safe-area-inset-top)}.van-popup__close-icon{color:var(--popup-close-icon-color,#969799);font-size:var(--popup-close-icon-size,18px);position:absolute;z-index:var(--popup-close-icon-z-index,1)}.van-popup__close-icon--top-left{left:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--top-right{right:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-left{bottom:var(--popup-close-icon-margin,16px);left:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-right{bottom:var(--popup-close-icon-margin,16px);right:var(--popup-close-icon-margin,16px)}.van-popup__close-icon:active{opacity:.6}.van-scale-enter-active,.van-scale-leave-active{transition-property:opacity,transform}.van-scale-enter,.van-scale-leave-to{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-center-enter-active,.van-center-leave-active{transition-property:opacity}.van-center-enter,.van-center-leave-to{opacity:0}.van-bottom-enter-active,.van-bottom-leave-active,.van-left-enter-active,.van-left-leave-active,.van-right-enter-active,.van-right-leave-active,.van-top-enter-active,.van-top-leave-active{transition-property:transform}.van-bottom-enter,.van-bottom-leave-to{transform:translate3d(0,100%,0)}.van-top-enter,.van-top-leave-to{transform:translate3d(0,-100%,0)}.van-left-enter,.van-left-leave-to{transform:translate3d(-100%,-50%,0)}.van-right-enter,.van-right-leave-to{transform:translate3d(100%,-50%,0)}
|
||||
14
lib/popup/popup.wxml
Normal file
14
lib/popup/popup.wxml
Normal file
@ -0,0 +1,14 @@
|
||||
<view
|
||||
wx:if="{{ inited }}"
|
||||
class="custom-class {{ classes }} {{ utils.bem('popup', [position, { round, safe: safeAreaInsetBottom, safeTop: safeAreaInsetTop, safeTabBar: safeAreaTabBar }]) }}"
|
||||
style="{{ computed.popupStyle({ zIndex, currentDuration, display, customStyle }) }}"
|
||||
bind:transitionend="onTransitionEnd"
|
||||
>
|
||||
<slot />
|
||||
<van-icon
|
||||
wx:if="{{ closeable }}"
|
||||
name="{{ closeIcon }}"
|
||||
class="close-icon-class van-popup__close-icon van-popup__close-icon--{{ closeIconPosition }}"
|
||||
bind:tap="onClickCloseIcon"
|
||||
/>
|
||||
</view>
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vant/weapp",
|
||||
"version": "1.10.13",
|
||||
"version": "1.10.14",
|
||||
"author": "vant-ui",
|
||||
"license": "MIT",
|
||||
"miniprogram": "lib",
|
||||
|
||||
@ -34,6 +34,10 @@ VantComponent({
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
rootPortal: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
|
||||
data: {
|
||||
@ -41,6 +45,7 @@ VantComponent({
|
||||
showPopup: false,
|
||||
showWrapper: false,
|
||||
displayTitle: '',
|
||||
safeAreaTabBar: false,
|
||||
},
|
||||
|
||||
methods: {
|
||||
@ -58,6 +63,7 @@ VantComponent({
|
||||
activeColor,
|
||||
closeOnClickOverlay,
|
||||
direction,
|
||||
safeAreaTabBar,
|
||||
} = this.parent.data;
|
||||
|
||||
this.setData({
|
||||
@ -66,6 +72,7 @@ VantComponent({
|
||||
activeColor,
|
||||
closeOnClickOverlay,
|
||||
direction,
|
||||
safeAreaTabBar,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@ -12,7 +12,9 @@
|
||||
overlay="{{ overlay }}"
|
||||
position="{{ direction === 'down' ? 'top' : 'bottom' }}"
|
||||
duration="{{ transition ? duration : 0 }}"
|
||||
safe-area-tab-bar="{{ safeAreaTabBar }}"
|
||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||
rootPortal="{{ rootPortal }}"
|
||||
bind:enter="onOpen"
|
||||
bind:leave="onClose"
|
||||
bind:close="toggle"
|
||||
|
||||
@ -182,6 +182,7 @@ Page({
|
||||
| duration | 动画时长,单位毫秒 | _number_ | `200` |
|
||||
| direction | 菜单展开方向,可选值为 up | _string_ | `down` |
|
||||
| overlay | 是否显示遮罩层 | _boolean_ | `true` |
|
||||
| safe-area-tab-bar `v1.10.14`| 是否留出底部 tabbar 安全距离 | _boolean_ | `false` |
|
||||
| close-on-click-overlay | 是否在点击遮罩层后关闭菜单 | _boolean_ | `true` |
|
||||
| close-on-click-outside | 是否在点击外部 menu 后关闭菜单 | _boolean_ | `true` |
|
||||
|
||||
@ -196,6 +197,7 @@ Page({
|
||||
| title-class | 标题额外类名,建议使用自定义样式 item-title-class 代替 | _string_ | - |
|
||||
| popup-style | 自定义弹出层样式 | _string_ | - |
|
||||
| use-before-toggle `v1.10.12` | 是否开启下拉菜单打开或者关闭前校验 | _boolean_ | `false` |
|
||||
| root-portal `v1.10.14` | 是否从页面子树中脱离出来,用于解决各种 fixed 失效问题,微信基础库 >= `2.25.2 ` | _boolean_ | `false` |
|
||||
|
||||
### DropdownItem Events
|
||||
|
||||
|
||||
@ -36,6 +36,10 @@ VantComponent({
|
||||
value: 'down',
|
||||
observer: 'updateChildrenData',
|
||||
},
|
||||
safeAreaTabBar: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
|
||||
@ -94,7 +94,8 @@ Page({
|
||||
| duration | 动画时长,单位秒 | _string \| number_ | `0.3` |
|
||||
| class-name | 自定义类名 | _string_ | - |
|
||||
| custom-style | 自定义样式 | _string_ | - |
|
||||
| lock-scroll `v1.7.3` | 是否锁定背景滚动,锁定时蒙层里的内容也将无法滚动 | _boolean_ | true |
|
||||
| lock-scroll `v1.7.3` | 是否锁定背景滚动,锁定时蒙层里的内容也将无法滚动 | _boolean_ | `true` |
|
||||
| root-portal `v1.10.14` | 是否从页面中脱离出来,用于解决各种 fixed 失效问题,微信基础库 >= `2.25.2 ` | _boolean_ | `false` |
|
||||
|
||||
### Events
|
||||
|
||||
|
||||
@ -16,6 +16,10 @@ VantComponent({
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
rootPortal: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
@ -1,21 +1,7 @@
|
||||
<van-transition
|
||||
wx:if="{{ lockScroll }}"
|
||||
show="{{ show }}"
|
||||
custom-class="van-overlay custom-class"
|
||||
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-class"
|
||||
custom-style="z-index: {{ zIndex }}; {{ customStyle }}"
|
||||
duration="{{ duration }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<slot></slot>
|
||||
</van-transition>
|
||||
<import src="./overlay.wxml" />
|
||||
|
||||
<root-portal wx:if="{{ rootPortal }}">
|
||||
<include src="./overlay.wxml" />
|
||||
</root-portal>
|
||||
|
||||
<include wx:else src="./overlay.wxml" />
|
||||
|
||||
10
packages/overlay/overlay.wxml
Normal file
10
packages/overlay/overlay.wxml
Normal file
@ -0,0 +1,10 @@
|
||||
<van-transition
|
||||
show="{{ show }}"
|
||||
custom-class="van-overlay custom-class"
|
||||
custom-style="z-index: {{ zIndex }}; {{ customStyle }}"
|
||||
duration="{{ duration }}"
|
||||
bind:tap="onClick"
|
||||
catch:touchmove="{{ lockScroll ? 'noop' : ''}}"
|
||||
>
|
||||
<slot></slot>
|
||||
</van-transition>
|
||||
@ -141,6 +141,7 @@ Page({
|
||||
| safe-area-inset-top | 是否留出顶部安全距离(状态栏高度) | _boolean_ | `false` |
|
||||
| safe-area-tab-bar | 是否留出底部 tabbar 安全距离(在使用 tabbar 组件 & 小程序自定义 tabbar 时,popup 组件层级无法盖住 tabbar) | _boolean_ | `false` |
|
||||
| lock-scroll `v1.7.3` | 是否锁定背景滚动 | _boolean_ | `true` |
|
||||
| root-portal `v1.10.14` | 是否从页面中脱离出来,用于解决各种 fixed 失效问题,微信基础库 >= `2.25.2 ` | _boolean_ | `false` |
|
||||
|
||||
### Events
|
||||
|
||||
|
||||
@ -101,7 +101,8 @@
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
&--bottom&--safeTabBar {
|
||||
&--bottom&--safeTabBar,
|
||||
&--top&--safeTabBar {
|
||||
bottom: var(--tabbar-height, @tabbar-height);
|
||||
}
|
||||
|
||||
|
||||
@ -64,6 +64,10 @@ VantComponent({
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
rootPortal: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
|
||||
<import src="./popup.wxml" />
|
||||
|
||||
<van-overlay
|
||||
wx:if="{{ overlay }}"
|
||||
show="{{ show }}"
|
||||
@ -9,18 +11,11 @@
|
||||
duration="{{ duration }}"
|
||||
bind:click="onClickOverlay"
|
||||
lock-scroll="{{ lockScroll }}"
|
||||
root-portal="{{ rootPortal }}"
|
||||
/>
|
||||
<view
|
||||
wx:if="{{ inited }}"
|
||||
class="custom-class {{ classes }} {{ utils.bem('popup', [position, { round, safe: safeAreaInsetBottom, safeTop: safeAreaInsetTop, safeTabBar: safeAreaTabBar }]) }}"
|
||||
style="{{ computed.popupStyle({ zIndex, currentDuration, display, customStyle }) }}"
|
||||
bind:transitionend="onTransitionEnd"
|
||||
>
|
||||
<slot />
|
||||
<van-icon
|
||||
wx:if="{{ closeable }}"
|
||||
name="{{ closeIcon }}"
|
||||
class="close-icon-class van-popup__close-icon van-popup__close-icon--{{ closeIconPosition }}"
|
||||
bind:tap="onClickCloseIcon"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<root-portal wx:if="{{ rootPortal }}">
|
||||
<include src="./popup.wxml" />
|
||||
</root-portal>
|
||||
|
||||
<include wx:else src="./popup.wxml" />
|
||||
|
||||
14
packages/popup/popup.wxml
Normal file
14
packages/popup/popup.wxml
Normal file
@ -0,0 +1,14 @@
|
||||
<view
|
||||
wx:if="{{ inited }}"
|
||||
class="custom-class {{ classes }} {{ utils.bem('popup', [position, { round, safe: safeAreaInsetBottom, safeTop: safeAreaInsetTop, safeTabBar: safeAreaTabBar }]) }}"
|
||||
style="{{ computed.popupStyle({ zIndex, currentDuration, display, customStyle }) }}"
|
||||
bind:transitionend="onTransitionEnd"
|
||||
>
|
||||
<slot />
|
||||
<van-icon
|
||||
wx:if="{{ closeable }}"
|
||||
name="{{ closeIcon }}"
|
||||
class="close-icon-class van-popup__close-icon van-popup__close-icon--{{ closeIconPosition }}"
|
||||
bind:tap="onClickCloseIcon"
|
||||
/>
|
||||
</view>
|
||||
Loading…
x
Reference in New Issue
Block a user