Compare commits

..

No commits in common. "4900b2be283194b95f765a680465da21bf52534f" and "12b2fef7bd3fba6827f3da715de72dca71ba7c2e" have entirely different histories.

8 changed files with 5 additions and 23 deletions

View File

@ -1,6 +1,5 @@
import { defineComponent, type ExtractPropTypes } from 'vue';
import { truthProp, createNamespace, BORDER_TOP_BOTTOM } from '../utils';
import { useScopeId } from '../composables/use-scope-id';
const [name, bem] = createNamespace('cell-group');
@ -27,7 +26,6 @@ export default defineComponent({
{ [BORDER_TOP_BOTTOM]: props.border && !props.inset },
]}
{...attrs}
{...useScopeId()}
>
{slots.default?.()}
</div>

View File

@ -1,8 +0,0 @@
import { getCurrentInstance } from 'vue';
// Fix failed to get scopeId when using teleport & fragment
// https://github.com/vuejs/core/issues/2669
export const useScopeId = () => {
const { scopeId } = getCurrentInstance()?.vnode || {};
return scopeId ? { [scopeId]: '' } : null;
};

View File

@ -27,7 +27,7 @@ import { useSyncPropRef } from '../composables/use-sync-prop-ref';
export const floatingPanelProps = {
height: makeNumericProp(0),
anchors: makeArrayProp<number>(),
duration: makeNumericProp(0.3),
duration: makeNumericProp(0.2),
contentDraggable: truthProp,
lockScroll: Boolean,
safeAreaInsetBottom: truthProp,
@ -71,9 +71,7 @@ export default defineComponent({
const rootStyle = computed(() => ({
height: addUnit(boundary.value.max),
transform: `translateY(calc(100% + ${addUnit(-height.value)}))`,
transition: !dragging.value
? `transform ${props.duration}s cubic-bezier(0.18, 0.89, 0.32, 1.28)`
: 'none',
transition: !dragging.value ? `transform ${props.duration}s` : 'none',
}));
const ease = (moveY: number): number => {

View File

@ -20,7 +20,6 @@
border-top-left-radius: var(--van-floating-panel-border-radius);
border-top-right-radius: var(--van-floating-panel-border-radius);
background: var(--van-floating-panel-background);
will-change: transform;
&::after {
content: '';

View File

@ -62,7 +62,7 @@ exports[`should render demo and match snapshot 1`] = `
>
<div
class="van-floating-panel van-safe-area-bottom"
style="height: 461px; transform: translateY(calc(100% + -100px)); transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);"
style="height: 461px; transform: translateY(calc(100% + -100px)); transition: transform 0.2s;"
>
<div class="van-floating-panel__header">
<div class="van-floating-panel__header-bar">

View File

@ -3,7 +3,7 @@
exports[`should drag adsorption effect when anchors props is [100, 200, 400] 1`] = `
<div
class="van-floating-panel van-safe-area-bottom"
style="height: 400px; transform: translateY(calc(100% + -100px)); transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);"
style="height: 400px; transform: translateY(calc(100% + -100px)); transition: transform 0.2s;"
>
<div class="van-floating-panel__header">
<div class="van-floating-panel__header-bar">
@ -18,7 +18,7 @@ exports[`should drag adsorption effect when anchors props is [100, 200, 400] 1`]
exports[`should minHeight 100 and maxHeight 0.6 innerHeight when anchors props do not 1`] = `
<div
class="van-floating-panel van-safe-area-bottom"
style="height: 461px; transform: translateY(calc(100% + -100px)); transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);"
style="height: 461px; transform: translateY(calc(100% + -100px)); transition: transform 0.2s;"
>
<div class="van-floating-panel__header">
<div class="van-floating-panel__header-bar">

View File

@ -31,7 +31,6 @@ import {
// Composables
import { useClickAway } from '@vant/use';
import { useScopeId } from '../composables/use-scope-id';
import { useSyncPropRef } from '../composables/use-sync-prop-ref';
// Components
@ -266,7 +265,6 @@ export default defineComponent({
lockScroll={false}
onUpdate:show={updateShow}
{...attrs}
{...useScopeId()}
{...pick(props, popupProps)}
>
{props.showArrow && <div class={bem('arrow')} />}

View File

@ -32,7 +32,6 @@ import { useLockScroll } from '../composables/use-lock-scroll';
import { useLazyRender } from '../composables/use-lazy-render';
import { POPUP_TOGGLE_KEY } from '../composables/on-popup-reopen';
import { useGlobalZIndex } from '../composables/use-global-z-index';
import { useScopeId } from '../composables/use-scope-id';
// Components
import { Icon } from '../icon';
@ -144,7 +143,6 @@ export default defineComponent({
customStyle={props.overlayStyle}
role={props.closeOnClickOverlay ? 'button' : undefined}
tabindex={props.closeOnClickOverlay ? 0 : undefined}
{...useScopeId()}
onClick={onClickOverlay}
/>
);
@ -207,7 +205,6 @@ export default defineComponent({
]}
onKeydown={onKeydown}
{...attrs}
{...useScopeId()}
>
{slots.default?.()}
{renderCloseIcon()}