diff --git a/dist/action-sheet/index.js b/dist/action-sheet/index.js index aee6999b7..9c4879c36 100644 --- a/dist/action-sheet/index.js +++ b/dist/action-sheet/index.js @@ -36,6 +36,10 @@ VantComponent({ type: Boolean, value: true, }, + rootPortal: { + type: Boolean, + value: false, + }, }, methods: { onSelect(event) { diff --git a/dist/action-sheet/index.wxml b/dist/action-sheet/index.wxml index d59a45d63..6311e3344 100644 --- a/dist/action-sheet/index.wxml +++ b/dist/action-sheet/index.wxml @@ -9,6 +9,7 @@ custom-class="van-action-sheet custom-class" safe-area-inset-bottom="{{ safeAreaInsetBottom }}" close-on-click-overlay="{{ closeOnClickOverlay }}" + root-portal="{{ rootPortal }}" bind:close="onClickOverlay" > diff --git a/dist/calendar/index.js b/dist/calendar/index.js index bd3b88315..515de4234 100644 --- a/dist/calendar/index.js +++ b/dist/calendar/index.js @@ -113,6 +113,10 @@ VantComponent({ value: 0, }, readonly: Boolean, + rootPortal: { + type: Boolean, + value: false, + }, }, data: { subtitle: '', diff --git a/dist/calendar/index.wxml b/dist/calendar/index.wxml index 9667eef9d..9d0fc6bff 100644 --- a/dist/calendar/index.wxml +++ b/dist/calendar/index.wxml @@ -13,6 +13,7 @@ closeable="{{ showTitle || showSubtitle }}" close-on-click-overlay="{{ closeOnClickOverlay }}" safe-area-inset-bottom="{{ safeAreaInsetBottom }}" + root-portal="{{ rootPortal }}" bind:enter="onOpen" bind:close="onClose" bind:after-enter="onOpened" diff --git a/dist/cascader/index.js b/dist/cascader/index.js index 058e929e5..03680f593 100644 --- a/dist/cascader/index.js +++ b/dist/cascader/index.js @@ -49,6 +49,7 @@ VantComponent({ value: defaultFieldNames, observer: 'updateFieldNames', }, + useTitleSlot: Boolean, }, data: { tabs: [], diff --git a/dist/cascader/index.wxml b/dist/cascader/index.wxml index 1794b8294..94172341d 100644 --- a/dist/cascader/index.wxml +++ b/dist/cascader/index.wxml @@ -1,7 +1,8 @@ - {{ title }} + + {{ title }} { - if (this.status !== 'enter') { + this.waitEnterEndPromise = new Promise((resolve) => { + const { duration, name } = this.data; + const classNames = getClassNames(name); + const currentDuration = isObj(duration) ? duration.enter : duration; + if (this.status === 'enter') { return; } - this.$emit('enter'); - this.setData({ - inited: true, - display: true, - classes: classNames.enter, - currentDuration, - }); + this.status = 'enter'; + this.$emit('before-enter'); requestAnimationFrame(() => { if (this.status !== 'enter') { return; } - this.transitionEnded = false; - this.setData({ classes: classNames['enter-to'] }); + this.$emit('enter'); + this.setData({ + inited: true, + display: true, + classes: classNames.enter, + currentDuration, + }); + requestAnimationFrame(() => { + if (this.status !== 'enter') { + return; + } + this.transitionEnded = false; + this.setData({ classes: classNames['enter-to'] }); + resolve(); + }); }); }); }, leave() { - if (!this.data.display) { + if (!this.waitEnterEndPromise) return; - } - const { duration, name } = this.data; - const classNames = getClassNames(name); - const currentDuration = isObj(duration) ? duration.leave : duration; - this.status = 'leave'; - this.$emit('before-leave'); - requestAnimationFrame(() => { - if (this.status !== 'leave') { + this.waitEnterEndPromise.then(() => { + if (!this.data.display) { return; } - this.$emit('leave'); - this.setData({ - classes: classNames.leave, - currentDuration, - }); + const { duration, name } = this.data; + const classNames = getClassNames(name); + const currentDuration = isObj(duration) ? duration.leave : duration; + this.status = 'leave'; + this.$emit('before-leave'); requestAnimationFrame(() => { if (this.status !== 'leave') { return; } - this.transitionEnded = false; - setTimeout(() => this.onTransitionEnd(), currentDuration); - this.setData({ classes: classNames['leave-to'] }); + this.$emit('leave'); + this.setData({ + classes: classNames.leave, + currentDuration, + }); + requestAnimationFrame(() => { + if (this.status !== 'leave') { + return; + } + this.transitionEnded = false; + setTimeout(() => this.onTransitionEnd(), currentDuration); + this.setData({ classes: classNames['leave-to'] }); + }); }); }); }, diff --git a/dist/share-sheet/index.js b/dist/share-sheet/index.js index a6ce016ca..ad2ccf474 100644 --- a/dist/share-sheet/index.js +++ b/dist/share-sheet/index.js @@ -36,6 +36,10 @@ VantComponent({ type: null, value: 300, }, + rootPortal: { + type: Boolean, + value: false, + }, }, methods: { onClickOverlay() { diff --git a/dist/share-sheet/index.wxml b/dist/share-sheet/index.wxml index cefc3af44..72a5b2533 100644 --- a/dist/share-sheet/index.wxml +++ b/dist/share-sheet/index.wxml @@ -11,6 +11,7 @@ overlay-style="{{ overlayStyle }}" close-on-click-overlay="{{ closeOnClickOverlay }}" safe-area-inset-bottom="{{ safeAreaInsetBottom }}" + root-portal="{{ rootPortal }}" bind:close="onClose" bind:click-overlay="onClickOverlay" > diff --git a/dist/uploader/shared.js b/dist/uploader/shared.js index 3ac6f8a34..c481c23a4 100644 --- a/dist/uploader/shared.js +++ b/dist/uploader/shared.js @@ -40,7 +40,7 @@ export const mediaProps = { }, mediaType: { type: Array, - value: ['image', 'video'], + value: ['image', 'video', 'mix'], }, maxDuration: { type: Number, diff --git a/dist/uploader/utils.js b/dist/uploader/utils.js index 9cae9fc4e..f2aa88975 100644 --- a/dist/uploader/utils.js +++ b/dist/uploader/utils.js @@ -33,7 +33,7 @@ function formatVideo(res) { ]; } function formatMedia(res) { - return res.tempFiles.map((item) => (Object.assign(Object.assign({}, pickExclude(item, ['fileType', 'thumbTempFilePath', 'tempFilePath'])), { type: res.type, url: item.tempFilePath, thumb: res.type === 'video' ? item.thumbTempFilePath : item.tempFilePath }))); + return res.tempFiles.map((item) => (Object.assign(Object.assign({}, pickExclude(item, ['fileType', 'thumbTempFilePath', 'tempFilePath'])), { type: item.fileType, url: item.tempFilePath, thumb: item.fileType === 'video' ? item.thumbTempFilePath : item.tempFilePath }))); } function formatFile(res) { return res.tempFiles.map((item) => (Object.assign(Object.assign({}, pickExclude(item, ['path'])), { url: item.path }))); diff --git a/lib/action-sheet/index.js b/lib/action-sheet/index.js index a39818af2..8403b689e 100644 --- a/lib/action-sheet/index.js +++ b/lib/action-sheet/index.js @@ -38,6 +38,10 @@ var button_1 = require("../mixins/button"); type: Boolean, value: true, }, + rootPortal: { + type: Boolean, + value: false, + }, }, methods: { onSelect: function (event) { diff --git a/lib/action-sheet/index.wxml b/lib/action-sheet/index.wxml index d59a45d63..6311e3344 100644 --- a/lib/action-sheet/index.wxml +++ b/lib/action-sheet/index.wxml @@ -9,6 +9,7 @@ custom-class="van-action-sheet custom-class" safe-area-inset-bottom="{{ safeAreaInsetBottom }}" close-on-click-overlay="{{ closeOnClickOverlay }}" + root-portal="{{ rootPortal }}" bind:close="onClickOverlay" > diff --git a/lib/calendar/index.js b/lib/calendar/index.js index eea875160..7a7324dac 100644 --- a/lib/calendar/index.js +++ b/lib/calendar/index.js @@ -129,6 +129,10 @@ var getTime = function (date) { value: 0, }, readonly: Boolean, + rootPortal: { + type: Boolean, + value: false, + }, }, data: { subtitle: '', diff --git a/lib/calendar/index.wxml b/lib/calendar/index.wxml index 9667eef9d..9d0fc6bff 100644 --- a/lib/calendar/index.wxml +++ b/lib/calendar/index.wxml @@ -13,6 +13,7 @@ closeable="{{ showTitle || showSubtitle }}" close-on-click-overlay="{{ closeOnClickOverlay }}" safe-area-inset-bottom="{{ safeAreaInsetBottom }}" + root-portal="{{ rootPortal }}" bind:enter="onOpen" bind:close="onClose" bind:after-enter="onOpened" diff --git a/lib/cascader/index.js b/lib/cascader/index.js index 63915ee38..1b45831b4 100644 --- a/lib/cascader/index.js +++ b/lib/cascader/index.js @@ -60,6 +60,7 @@ var defaultFieldNames = { value: defaultFieldNames, observer: 'updateFieldNames', }, + useTitleSlot: Boolean, }, data: { tabs: [], diff --git a/lib/cascader/index.wxml b/lib/cascader/index.wxml index 1794b8294..94172341d 100644 --- a/lib/cascader/index.wxml +++ b/lib/cascader/index.wxml @@ -1,7 +1,8 @@ - {{ title }} + + {{ title }} diff --git a/lib/uploader/shared.js b/lib/uploader/shared.js index 4e0772714..b88fea74d 100644 --- a/lib/uploader/shared.js +++ b/lib/uploader/shared.js @@ -43,7 +43,7 @@ exports.mediaProps = { }, mediaType: { type: Array, - value: ['image', 'video'], + value: ['image', 'video', 'mix'], }, maxDuration: { type: Number, diff --git a/lib/uploader/utils.js b/lib/uploader/utils.js index 379aa80c3..a5d49c605 100644 --- a/lib/uploader/utils.js +++ b/lib/uploader/utils.js @@ -49,7 +49,7 @@ function formatVideo(res) { ]; } function formatMedia(res) { - return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['fileType', 'thumbTempFilePath', 'tempFilePath'])), { type: res.type, url: item.tempFilePath, thumb: res.type === 'video' ? item.thumbTempFilePath : item.tempFilePath })); }); + return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['fileType', 'thumbTempFilePath', 'tempFilePath'])), { type: item.fileType, url: item.tempFilePath, thumb: item.fileType === 'video' ? item.thumbTempFilePath : item.tempFilePath })); }); } function formatFile(res) { return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['path'])), { url: item.path })); });