@mpxjs/webpack-plugin 2.10.3-beta.6 → 2.10.3-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@ import Animated, { useAnimatedStyle, interpolate } from 'react-native-reanimated
|
|
|
2
2
|
import { forwardRef, useRef, useContext } from 'react';
|
|
3
3
|
import useInnerProps from './getInnerListeners';
|
|
4
4
|
import useNodesRef from './useNodesRef'; // 引入辅助函数
|
|
5
|
-
import { useTransformStyle, splitStyle, splitProps, wrapChildren, useLayout } from './utils';
|
|
5
|
+
import { useTransformStyle, splitStyle, splitProps, wrapChildren, useLayout, isHarmony } from './utils';
|
|
6
6
|
import { SwiperContext } from './context';
|
|
7
7
|
const _SwiperItem = forwardRef((props, ref) => {
|
|
8
8
|
const { 'enable-var': enableVar, 'external-var-context': externalVarContext, style, customStyle, itemIndex } = props;
|
|
@@ -30,7 +30,7 @@ const _SwiperItem = forwardRef((props, ref) => {
|
|
|
30
30
|
'style'
|
|
31
31
|
], { layoutRef });
|
|
32
32
|
const itemAnimatedStyle = useAnimatedStyle(() => {
|
|
33
|
-
if (!step.value)
|
|
33
|
+
if (!step.value && !isHarmony)
|
|
34
34
|
return {};
|
|
35
35
|
const inputRange = [step.value, 0];
|
|
36
36
|
const outputRange = [0.7, 1];
|
|
@@ -3,7 +3,7 @@ import Animated, { useAnimatedStyle, interpolate, SharedValue } from 'react-nati
|
|
|
3
3
|
import { ReactNode, forwardRef, useRef, useContext } from 'react'
|
|
4
4
|
import useInnerProps from './getInnerListeners'
|
|
5
5
|
import useNodesRef, { HandlerRef } from './useNodesRef' // 引入辅助函数
|
|
6
|
-
import { useTransformStyle, splitStyle, splitProps, wrapChildren, useLayout } from './utils'
|
|
6
|
+
import { useTransformStyle, splitStyle, splitProps, wrapChildren, useLayout, isHarmony } from './utils'
|
|
7
7
|
import { SwiperContext } from './context'
|
|
8
8
|
|
|
9
9
|
interface SwiperItemProps {
|
|
@@ -73,7 +73,7 @@ const _SwiperItem = forwardRef<HandlerRef<View, SwiperItemProps>, SwiperItemProp
|
|
|
73
73
|
'style'
|
|
74
74
|
], { layoutRef })
|
|
75
75
|
const itemAnimatedStyle = useAnimatedStyle(() => {
|
|
76
|
-
if (!step.value) return {}
|
|
76
|
+
if (!step.value && !isHarmony) return {}
|
|
77
77
|
const inputRange = [step.value, 0]
|
|
78
78
|
const outputRange = [0.7, 1]
|
|
79
79
|
// 实现元素的宽度跟随step从0到真实宽度,且不能触发重新渲染整个组件,通过AnimatedStyle的方式实现
|