Skip to content

Commit 107cada

Browse files
committed
fix: 真机上增加内容
1 parent 04df7ef commit 107cada

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@nutui/nutui-react-taro",
3-
"version": "3.0.0-beta.10",
2+
"name": "@dongdesign/components",
3+
"version": "3.0.0-beta.0",
44
"style": "dist/style.css",
55
"main": "dist/nutui.react.umd.js",
66
"module": "dist/es/packages/nutui.react.build.js",
@@ -40,10 +40,7 @@
4040
"LICENSE",
4141
"CHANGELOG.md"
4242
],
43-
"publishConfig": {
44-
"access": "public",
45-
"registry": "https://registry.npmjs.org/"
46-
},
43+
4744
"scripts": {
4845
"add": "node scripts/create-component-mode.js && npm run prepare",
4946
"add:taro:config": "node scripts/taro/generate-taro-route.js",

src/packages/loading/demos/taro/demo1.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Demo1 = () => {
2525
type="lottie"
2626
jsonData={data}
2727
lottieProps={{
28-
autoplay: false,
28+
autoPlay: false,
2929
loop: false,
3030
style: { width: 56, height: 56 },
3131
}}

src/packages/lottie/mp.taro.tsx

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { useImperativeHandle, useRef } from 'react'
22
import {
33
createSelectorQuery,
4+
getEnv,
45
getSystemInfoSync,
56
useReady,
67
useUnload,
78
} from '@tarojs/taro'
8-
import { Canvas } from '@tarojs/components'
99
import lottie from 'lottie-miniprogram'
1010
import useUuid from '@/utils/use-uuid'
1111
import { LottieProps } from './types'
@@ -82,7 +82,28 @@ export const Lottie = React.forwardRef((props: LottieProps, ref: any) => {
8282
animation.current.removeEventListener('complete', onComplete)
8383
animation.current && animation.current.destroy()
8484
})
85-
return <Canvas id={id} canvas-id={id} type="2d" style={style} />
85+
86+
return getEnv() === 'WEAPP' || getEnv() === 'JD' ? (
87+
<canvas
88+
id={id}
89+
// @ts-ignore
90+
// eslint-disable-next-line react/no-unknown-property
91+
canvasId={id}
92+
// eslint-disable-next-line react/no-unknown-property
93+
disalbeScroll
94+
type="2d"
95+
style={style}
96+
/>
97+
) : (
98+
<canvas
99+
id={id}
100+
// eslint-disable-next-line react/no-unknown-property
101+
canvas-id={id}
102+
// eslint-disable-next-line react/no-unknown-property
103+
disalbe-scroll
104+
style={style}
105+
/>
106+
)
86107
})
87108

88109
Lottie.displayName = 'NutLottie'

src/packages/pulltorefresh/pulltorefresh.taro.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export const PullToRefresh: FunctionComponent<Partial<PullToRefreshProps>> = (
176176
<View
177177
className={classes}
178178
style={props.style}
179+
catchMove
179180
onTouchStart={handleTouchStart}
180181
onTouchMove={handleTouchMove}
181182
onTouchEnd={handleTouchEnd}

0 commit comments

Comments
 (0)