Skip to content

Commit

Permalink
fix: 真机上增加内容
Browse files Browse the repository at this point in the history
  • Loading branch information
oasis-cloud committed Dec 30, 2024
1 parent 04df7ef commit 107cada
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nutui/nutui-react-taro",
"version": "3.0.0-beta.10",
"name": "@dongdesign/components",
"version": "3.0.0-beta.0",
"style": "dist/style.css",
"main": "dist/nutui.react.umd.js",
"module": "dist/es/packages/nutui.react.build.js",
Expand Down Expand Up @@ -40,10 +40,7 @@
"LICENSE",
"CHANGELOG.md"
],
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},

"scripts": {
"add": "node scripts/create-component-mode.js && npm run prepare",
"add:taro:config": "node scripts/taro/generate-taro-route.js",
Expand Down
2 changes: 1 addition & 1 deletion src/packages/loading/demos/taro/demo1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Demo1 = () => {
type="lottie"
jsonData={data}
lottieProps={{
autoplay: false,
autoPlay: false,
loop: false,
style: { width: 56, height: 56 },
}}
Expand Down
25 changes: 23 additions & 2 deletions src/packages/lottie/mp.taro.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useImperativeHandle, useRef } from 'react'
import {
createSelectorQuery,
getEnv,
getSystemInfoSync,
useReady,
useUnload,
} from '@tarojs/taro'
import { Canvas } from '@tarojs/components'
import lottie from 'lottie-miniprogram'
import useUuid from '@/utils/use-uuid'
import { LottieProps } from './types'
Expand Down Expand Up @@ -82,7 +82,28 @@ export const Lottie = React.forwardRef((props: LottieProps, ref: any) => {
animation.current.removeEventListener('complete', onComplete)
animation.current && animation.current.destroy()
})
return <Canvas id={id} canvas-id={id} type="2d" style={style} />

return getEnv() === 'WEAPP' || getEnv() === 'JD' ? (
<canvas
id={id}
// @ts-ignore
// eslint-disable-next-line react/no-unknown-property
canvasId={id}
// eslint-disable-next-line react/no-unknown-property
disalbeScroll
type="2d"
style={style}
/>
) : (
<canvas
id={id}
// eslint-disable-next-line react/no-unknown-property
canvas-id={id}
// eslint-disable-next-line react/no-unknown-property
disalbe-scroll
style={style}
/>
)
})

Lottie.displayName = 'NutLottie'
1 change: 1 addition & 0 deletions src/packages/pulltorefresh/pulltorefresh.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export const PullToRefresh: FunctionComponent<Partial<PullToRefreshProps>> = (
<View
className={classes}
style={props.style}
catchMove
onTouchStart={handleTouchStart}
onTouchMove={handleTouchMove}
onTouchEnd={handleTouchEnd}
Expand Down

0 comments on commit 107cada

Please sign in to comment.