Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tech
pi_gui
Commits
b0ed5aa2
Commit
b0ed5aa2
authored
1 year ago
by
余强
Browse files
Options
Download
Email Patches
Plain Diff
fix: 支持数组class
parent
77eb575a
master
adapte_newgui
new_direct
new_direct5.0
new_engine
npm_test
v5.0.30
v5.0.29
v5.0.28
v5.0.27
v5.0.26
v5.0.25
v5.0.24
v5.0.23
v5.0.22
v5.0.21
v5.0.20
v5.0.19
v5.0.18
v5.0.17
v5.0.16
v5.0.15
v5.0.14
v5.0.13
v5.0.12
v5.0.11
v5.0.10
v5.0.9
v5.0.8
v5.0.7
v5.0.6
v5.0.5
v5.0.4
v5.0.3
v5.0.2
v5.0.1
v4.0.3
v4.0.2
v4.0.1
v3.0.20
v3.0.19
v3.0.18
v3.0.17
v3.0.16
v3.0.15
v3.0.14
v3.0.13
v3.0.12
v3.0.10
v3.0.9
v3.0.8
v3.0.7
v3.0.6
v3.0.5
v3.0.4
v3.0.3
v3.0.2
v3.0.1
v3.0.0
v2.0.30
v2.0.29
v2.0.28
v2.0.27
v2.0.26
v2.0.25
v2.0.24
v2.0.23
v2.0.22
v2.0.21
v2.0.20
v2.0.19
v2.0.18
v2.0.17
v2.0.16
v2.0.15
v2.0.14
v2.0.13
v2.0.12
v2.0.11
v2.0.10
v2.0.9
v2.0.8
v2.0.7
v2.0.6
v2.0.5
v2.0.4
v2.0.3
v2.0.2
v2.0.1
v2.0.0
v1.0.35
v1.0.34
v1.0.33
v1.0.32
v1.0.31
v1.0.30
v1.0.29
v1.0.28
v1.0.27
v1.0.26
v1.0.25
v1.0.24
v1.0.23
v1.0.22
v1.0.21
v1.0.20
v1.0.19
v1.0.18
v1.0.17
v1.0.16
v1.0.15
v1.0.14
v1.0.13
v1.0.12
v1.0.11
v1.0.10
No related merge requests found
Pipeline
#2329
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/widget/direct.ts
+17
-11
src/widget/direct.ts
with
17 additions
and
11 deletions
+17
-11
src/widget/direct.ts
+
17
-
11
View file @
b0ed5aa2
...
...
@@ -1414,16 +1414,22 @@ export const patchSlot = (block: Block, w: Widget, param: Object, name = 'defaul
* @param w 组件
* @returns number
*/
export
const
classHash
=
(
value
:
string
,
w
?:
Widget
)
=>
{
if
(
!
w
)
{
// css
return
murmurhash3_32s
(
value
,
0
);
export
const
classHash
=
(
value
:
string
|
string
[],
w
?:
Widget
)
=>
{
let
_classHash
=
(
value
)
=>
{
if
(
!
w
)
{
// css
return
murmurhash3_32s
(
value
,
0
);
}
// wcss
let
_$meta
=
w
.
constructor
.
_$meta
if
(
!
_$meta
.
cssHash
)
{
_$meta
.
cssHash
=
murmurhash3_32s
(
_$meta
.
css
,
0
);
}
return
murmurhash3_32s
(
value
,
_$meta
.
cssHash
);
}
// wcss
let
_$meta
=
w
.
constructor
.
_$meta
if
(
!
_$meta
.
cssHash
)
{
_$meta
.
cssHash
=
murmurhash3_32s
(
_$meta
.
css
,
0
);
if
(
Array
.
isArray
(
value
))
{
return
value
.
map
((
v
)
=>
_classHash
(
v
))
}
return
murmurhash3_32s
(
value
,
_$meta
.
cssHash
);
return
_classHash
(
value
)
}
/**
* 初始化动画(由于动画文件被旧的组件系统拿走了,提供此方法,让旧的组件组件系统将动画数据注册过来)
...
...
@@ -1587,7 +1593,7 @@ export const defineAccessors = (wCostructor: new () => Widget, properties: strin
if
(
value
==
DirtyStage
.
Patch
)
{
for
(
let
i
=
0
;
i
<
r
.
length
;
i
++
)
{
this
.
_$info
[
r1
[
i
]]
=
this
.
_$info
[
r
[
i
]];
// 赋值dirty${i} = _dirty${i}
// 清空_dirty${i}
// 清空_dirty${i}
this
.
_$info
[
r
[
i
]]
=
0
;
// _dirty${i} = 0
}
}
else
if
(
value
==
DirtyStage
.
Clear
)
{
...
...
@@ -1595,7 +1601,7 @@ export const defineAccessors = (wCostructor: new () => Widget, properties: strin
this
.
_$info
[
i
]
=
0
;
// dirty${i} = 0
}
}
else
if
(
value
==
DirtyStage
.
Watch
)
{
for
(
let
i
=
0
;
i
<
r
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
r
.
length
;
i
++
)
{
this
.
_$info
[
r1
[
i
]]
=
this
.
_$info
[
r
[
i
]];
// 赋值dirty${i} = _dirty${i}
}
}
...
...
@@ -2182,7 +2188,7 @@ const patchForByList = (widget: Widget, oldNode: ForNode, source: any, createEac
let
index
=
0
;
iterObj
(
source
,
(
len
)
=>
{
// 先扩容
if
(
len
>
oldBlocks
.
length
)
{
if
(
len
>
oldBlocks
.
length
)
{
oldBlocks
.
length
=
len
;
}
},
(
item
,
name
,
i
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help