Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui-react
提交
cc5c64c7
N
nutui-react
项目概览
京东前端
/
nutui-react
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nutui-react
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
cc5c64c7
编写于
2月 08, 2023
作者:
O
oasis-cloud
提交者:
GitHub
2月 08, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修复 taro h5 有些 api 未导出导致报错 (#642)
上级
bf3ca299
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
27 addition
and
22 deletion
+27
-22
src/packages/address/customRender.taro.tsx
src/packages/address/customRender.taro.tsx
+2
-2
src/packages/animatingnumbers/countup.taro.tsx
src/packages/animatingnumbers/countup.taro.tsx
+2
-2
src/packages/ellipsis/ellipsis.taro.tsx
src/packages/ellipsis/ellipsis.taro.tsx
+2
-2
src/packages/infiniteloading/infiniteloading.taro.tsx
src/packages/infiniteloading/infiniteloading.taro.tsx
+2
-2
src/packages/signature/signature.taro.tsx
src/packages/signature/signature.taro.tsx
+15
-10
src/packages/watermark/watermark.taro.tsx
src/packages/watermark/watermark.taro.tsx
+4
-4
未找到文件。
src/packages/address/customRender.taro.tsx
浏览文件 @
cc5c64c7
import
React
,
{
FunctionComponent
,
useEffect
,
useState
,
useRef
}
from
'
react
'
import
{
createSelectorQuery
}
from
'
@tarojs/taro
'
import
Icon
from
'
@/packages/icon
'
import
bem
from
'
@/utils/bem
'
import
Elevator
from
'
@/packages/elevator/index.taro
'
...
...
@@ -32,7 +33,6 @@ const defaultProps = {
town
:
[],
height
:
'
200px
'
,
}
as
AddressProps
import
Taro
from
'
@tarojs/taro
'
export
const
CustomRender
:
FunctionComponent
<
Partial
<
AddressProps
>
&
React
.
HTMLAttributes
<
HTMLDivElement
>
...
...
@@ -147,7 +147,7 @@ export const CustomRender: FunctionComponent<
const
lineAnimation
=
(
index
:
string
|
number
)
=>
{
setTimeout
(()
=>
{
const
name
:
string
=
tabName
[
index
as
number
]
Taro
.
createSelectorQuery
()
createSelectorQuery
()
.
selectAll
(
`.
${
name
}
`
)
.
boundingClientRect
((
rects
:
any
)
=>
{
rects
&&
...
...
src/packages/animatingnumbers/countup.taro.tsx
浏览文件 @
cc5c64c7
...
...
@@ -5,7 +5,7 @@ import React, {
useRef
,
useState
,
}
from
'
react
'
import
Taro
from
'
@tarojs/taro
'
import
{
createSelectorQuery
}
from
'
@tarojs/taro
'
import
bem
from
'
@/utils/bem
'
export
interface
CountUpProps
{
...
...
@@ -62,7 +62,7 @@ export const CountUp: FunctionComponent<Partial<CountUpProps>> = (props) => {
const
setNumberTransform
=
()
=>
{
if
(
countupRef
.
current
&&
numerArr
.
length
)
{
const
query
=
Taro
.
createSelectorQuery
()
const
query
=
createSelectorQuery
()
.
selectAll
(
'
.nut-countup__listitem
'
)
.
node
((
numberItems
:
any
)
=>
{
const
transformArrCache
:
string
[]
=
[]
...
...
src/packages/ellipsis/ellipsis.taro.tsx
浏览文件 @
cc5c64c7
...
...
@@ -4,7 +4,7 @@ import React, {
useRef
,
useLayoutEffect
,
}
from
'
react
'
import
Taro
from
'
@tarojs/taro
'
import
{
createSelectorQuery
}
from
'
@tarojs/taro
'
import
{
useConfig
}
from
'
@/packages/configprovider/configprovider.taro
'
import
{
getRectByTaro
}
from
'
@/utils/useClientRect
'
...
...
@@ -100,7 +100,7 @@ export const Ellipsis: FunctionComponent<
const
getReference
=
async
()
=>
{
const
element
=
root
.
current
const
query
=
Taro
.
createSelectorQuery
()
const
query
=
createSelectorQuery
()
query
.
select
(
`#
${(
element
as
any
).
id
}
`
)
&&
query
.
select
(
`#
${(
element
as
any
).
id
}
`
)
...
...
src/packages/infiniteloading/infiniteloading.taro.tsx
浏览文件 @
cc5c64c7
import
React
,
{
useState
,
useEffect
,
useRef
,
FunctionComponent
}
from
'
react
'
import
classNames
from
'
classnames
'
import
{
ScrollView
}
from
'
@tarojs/components
'
import
Taro
from
'
@tarojs/taro
'
import
{
createSelectorQuery
}
from
'
@tarojs/taro
'
import
bem
from
'
@/utils/bem
'
import
Icon
from
'
@/packages/icon/index.taro
'
import
{
useConfig
}
from
'
@/packages/configprovider/configprovider.taro
'
...
...
@@ -114,7 +114,7 @@ export const Infiniteloading: FunctionComponent<
}
const
getParentElement
=
(
el
:
string
)
=>
{
return
Taro
.
createSelectorQuery
().
select
(
return
createSelectorQuery
().
select
(
containerId
?
`#
${
containerId
}
#
${
el
}
`
:
`#
${
el
}
`
)
}
...
...
src/packages/signature/signature.taro.tsx
浏览文件 @
cc5c64c7
/* eslint-disable react/no-unknown-property */
import
React
,
{
FunctionComponent
,
useEffect
,
useRef
,
useState
}
from
'
react
'
import
Taro
,
{
CanvasContext
}
from
'
@tarojs/taro
'
// import { Canvas } from '@tarojs/components'
import
{
getEnv
,
nextTick
,
createSelectorQuery
,
canvasToTempFilePath
,
CanvasContext
,
}
from
'
@tarojs/taro
'
import
Button
from
'
@/packages/button/index.taro
'
import
bem
from
'
@/utils/bem
'
import
{
useConfig
}
from
'
@/packages/configprovider/configprovider.taro
'
...
...
@@ -74,12 +79,12 @@ export const Signature: FunctionComponent<
let
mouseX
=
evt
.
x
||
evt
.
clientX
let
mouseY
=
evt
.
y
||
evt
.
clientY
if
(
Taro
.
getEnv
()
===
'
WEB
'
&&
canvasRef
.
current
)
{
if
(
getEnv
()
===
'
WEB
'
&&
canvasRef
.
current
)
{
const
coverPos
=
canvasRef
.
current
.
getBoundingClientRect
()
mouseX
=
evt
.
clientX
-
coverPos
.
left
mouseY
=
evt
.
clientY
-
coverPos
.
top
}
Taro
.
nextTick
(()
=>
{
nextTick
(()
=>
{
// ctx.current.lineCap = 'round'
// ctx.current.lineJoin = 'round'
ctx
.
current
?.
lineTo
(
mouseX
,
mouseY
)
...
...
@@ -104,14 +109,14 @@ export const Signature: FunctionComponent<
}
const
onSave
=
()
=>
{
Taro
.
createSelectorQuery
()
createSelectorQuery
()
.
select
(
`#
${
canvasId
}
`
)
.
fields
({
node
:
true
,
size
:
true
,
})
.
exec
((
res
)
=>
{
Taro
.
canvasToTempFilePath
({
canvasToTempFilePath
({
canvas
:
res
[
0
].
node
,
fileType
:
props
.
type
,
canvasId
:
`
${
canvasId
}
`
,
...
...
@@ -145,10 +150,10 @@ export const Signature: FunctionComponent<
}
const
initCanvas
=
()
=>
{
Taro
.
nextTick
(()
=>
{
nextTick
(()
=>
{
setTimeout
(()
=>
{
if
(
Taro
.
getEnv
()
===
'
WEAPP
'
||
Taro
.
getEnv
()
===
'
JD
'
)
{
Taro
.
createSelectorQuery
()
if
(
getEnv
()
===
'
WEAPP
'
||
getEnv
()
===
'
JD
'
)
{
createSelectorQuery
()
.
select
(
`#
${
canvasId
}
`
)
.
fields
(
{
...
...
@@ -188,7 +193,7 @@ export const Signature: FunctionComponent<
return
(
<
div
className
=
{
`
${
b
()}
${
className
}
`
}
{
...
rest
}
>
<
div
className
=
{
`
${
b
(
'
inner
'
)}
spcanvas_WEAPP`
}
ref
=
{
wrapRef
}
>
{
Taro
.
getEnv
()
===
'
WEAPP
'
||
Taro
.
getEnv
()
===
'
JD
'
?
(
{
getEnv
()
===
'
WEAPP
'
||
getEnv
()
===
'
JD
'
?
(
<
canvas
id
=
{
canvasId
}
ref
=
{
canvasRef
}
...
...
src/packages/watermark/watermark.taro.tsx
浏览文件 @
cc5c64c7
import
React
,
{
useState
,
useEffect
,
FunctionComponent
}
from
'
react
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
Taro
from
'
@tarojs/taro
'
import
{
getSystemInfo
,
createOffscreenCanvas
}
from
'
@tarojs/taro
'
import
classNames
from
'
classnames
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
bem
from
'
@/utils/bem
'
export
interface
WaterMarkProps
{
...
...
@@ -86,7 +86,7 @@ export const WaterMark: FunctionComponent<
const
init
=
()
=>
{
let
ratio
=
1
Taro
.
getSystemInfo
().
then
((
res
)
=>
{
getSystemInfo
().
then
((
res
)
=>
{
ratio
=
res
.
pixelRatio
const
canvasWidth
=
`
${(
gapX
+
width
)
*
ratio
}
px`
const
canvasHeight
=
`
${(
gapY
+
height
)
*
ratio
}
px`
...
...
@@ -100,7 +100,7 @@ export const WaterMark: FunctionComponent<
canvas
.
setAttribute
(
'
width
'
,
canvasWidth
)
canvas
.
setAttribute
(
'
height
'
,
canvasHeight
)
}
else
{
canvas
=
Taro
.
createOffscreenCanvas
({
canvas
=
createOffscreenCanvas
({
type
:
'
2d
'
,
width
:
Number
(
canvasWidth
),
height
:
Number
(
canvasHeight
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录