diff --git a/src/packages/swipe/demos/h5/demo2.tsx b/src/packages/swipe/demos/h5/demo2.tsx
index 50b2f0a04d..bcbe40b775 100644
--- a/src/packages/swipe/demos/h5/demo2.tsx
+++ b/src/packages/swipe/demos/h5/demo2.tsx
@@ -7,8 +7,8 @@ const ViewNode = (text: string, style: any) => {
{
return (
<>
<>
- {ViewNode('设置常买', {
- background: '#F8F8F8',
- color: '#1A1A1A',
+ {ViewNode('加常买', {
+ background: '#fff4e8',
+ color: '#b5691a',
})}
- {ViewNode('移入收藏', {
- background: '#ffcc00',
+ {ViewNode('收藏', {
+ background: '#ffbf00',
color: '#FFF',
})}
{ViewNode('看相似', {
- background: '#FF860D',
+ background: '#ff791a',
color: '#FFF',
})}
{ViewNode('删除', {
- background: '#FA2C19',
+ background: '#ff0f23',
color: '#FFF',
})}
>
diff --git a/src/packages/swipe/demos/taro/demo2.tsx b/src/packages/swipe/demos/taro/demo2.tsx
index 316ed74111..f575dbec02 100644
--- a/src/packages/swipe/demos/taro/demo2.tsx
+++ b/src/packages/swipe/demos/taro/demo2.tsx
@@ -10,8 +10,8 @@ const ViewNode = (text: string, style: any) => {
{
return (
<>
<>
- {ViewNode('设置常买', {
- backgroundColor: '#F8F8F8',
- color: '#1A1A1A',
+ {ViewNode('加常买', {
+ background: '#fff4e8',
+ color: '#b5691a',
})}
- {ViewNode('移入收藏', {
- backgroundColor: '#ffcc00',
+ {ViewNode('收藏', {
+ background: '#ffbf00',
color: '#FFF',
})}
{ViewNode('看相似', {
- backgroundColor: '#FF860D',
+ background: '#ff791a',
color: '#FFF',
})}
{ViewNode('删除', {
- backgroundColor: '#FA2C19',
+ background: '#ff0f23',
color: '#FFF',
})}
>
diff --git a/src/packages/swipe/swipe.taro.tsx b/src/packages/swipe/swipe.taro.tsx
index d74108cf28..0d78f08f24 100644
--- a/src/packages/swipe/swipe.taro.tsx
+++ b/src/packages/swipe/swipe.taro.tsx
@@ -9,7 +9,7 @@ import React, {
import classNames from 'classnames'
import { ITouchEvent, View } from '@tarojs/components'
import { BaseEventOrig } from '@tarojs/components/types/common'
-import { useReady } from '@tarojs/taro'
+import { nextTick, useReady } from '@tarojs/taro'
import { useTouch } from '@/hooks/use-touch'
import { getRectByTaro } from '@/utils/get-rect-by-taro'
import { ComponentDefaults } from '@/utils/typings'
@@ -58,7 +58,7 @@ export const Swipe = forwardRef<
setActionWidth((v: any) => ({ ...v, right: rightRect.width }))
}
}
- setTimeout(() => getWidth())
+ nextTick(() => getWidth())
})
const { children, className, style } = { ...defaultProps, ...props }