Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hzlh-beautifulFunFestival-snake-20241222
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
hzlh-beautifulFunFestival-snake-20241222
Commits
e27ea993
Commit
e27ea993
authored
Jan 07, 2025
by
俞嘉婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 规则太长不展示的问题-dom实现
parent
558fb4df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
RulePanel.ts
...estival-snake-20241222/assets/Scripts/Panels/RulePanel.ts
+30
-1
No files found.
hzlh-beautifulFunFestival-snake-20241222/assets/Scripts/Panels/RulePanel.ts
View file @
e27ea993
...
...
@@ -7,6 +7,7 @@ const {ccclass, property} = _decorator;
import
{
HTMLRichText
}
from
"../../Component/HTMLRichText/HTMLRichText"
;
import
{
getWebData
,
WebNetName
}
from
"../Utils/WebNet/WebNet"
;
import
{
game
}
from
"cc"
;
@
observer
@
ccclass
(
'RulePanel'
)
...
...
@@ -18,12 +19,40 @@ export default class RulePanel extends Panel {
@
property
(
Node
)
closeBtn
:
Node
=
null
;
@
property
(
Node
)
spNode
:
Node
=
null
;
dom
:
HTMLDivElement
=
null
;
onLoad
()
{
this
.
closeBtn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickClose
);
}
async
start
()
{
this
.
setRuleTxt
(
getWebData
(
WebNetName
.
tcs_Index
).
data
?.
rule
||
""
);
// this.setRuleTxt(getWebData(WebNetName.tcs_Index).data?.rule || "");
if
(
!
this
.
dom
)
{
this
.
dom
=
document
.
createElement
(
"div"
);
}
this
.
dom
.
innerHTML
=
`<div style="
position: absolute;
left: 1.34rem;
top: 4.14rem;
width: 4.85rem;
height: 7.2rem;
font-size: 0.21rem;
color: #590505;
overflow: hidden;
overflow-y: auto;
word-break: break-word;
">
${
getWebData
(
WebNetName
.
tcs_Index
).
data
?.
rule
||
""
}
<
/div
>
`;
game.container.appendChild(this.dom);
}
protected onDestroy() {
this.dom && this.dom.remove();
}
clickClose = () => {
...
...
Write
Preview
Markdown
is supported
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