Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
b796ce39
Commit
b796ce39
authored
May 28, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
乾坤传参问题
parent
66dc4260
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
App.js
src/App.js
+6
-3
index.js
src/index.js
+3
-1
index.js
src/util/index.js
+1
-1
No files found.
src/App.js
View file @
b796ce39
...
@@ -31,20 +31,23 @@ const AssetTree = loadable(()=> import('./view/Manage/AssetManage/Component/Asse
...
@@ -31,20 +31,23 @@ const AssetTree = loadable(()=> import('./view/Manage/AssetManage/Component/Asse
export
class
App
extends
React
.
Component
{
export
class
App
extends
React
.
Component
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
$$hostParams
=
null
;
this
.
state
=
{
this
.
state
=
{
hostParams
:
this
.
params
hostParams
:
null
};
};
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
setState
({
hostParams
:
this
.
props
?.
data
});
this
.
$$hostParams
=
$hostParams
.
subscribe
(()
=>
{
this
.
$$hostParams
=
$hostParams
.
subscribe
(()
=>
{
if
(
$hostParams
.
getValue
())
{
this
.
setState
({
hostParams
:
$hostParams
.
getValue
()
});
this
.
setState
({
hostParams
:
$hostParams
.
getValue
()
});
}
})
})
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
this
.
$$hostParams
?.
unsubscribe
()
this
.
$$hostParams
?.
unsubscribe
()
;
}
}
render
()
{
render
()
{
...
...
src/index.js
View file @
b796ce39
...
@@ -14,6 +14,7 @@ import { $hostParams } from "./util";
...
@@ -14,6 +14,7 @@ import { $hostParams } from "./util";
function
render
(
props
)
{
function
render
(
props
)
{
const
{
container
,
...
restProps
}
=
props
;
const
{
container
,
...
restProps
}
=
props
;
ReactDOM
.
render
(
ReactDOM
.
render
(
//解决主次应用样式冲突
//解决主次应用样式冲突
//https://qiankun.umijs.org/faq#how-to-guarantee-the-main-app-stylesheet-isolated-with-sub-apps
//https://qiankun.umijs.org/faq#how-to-guarantee-the-main-app-stylesheet-isolated-with-sub-apps
...
@@ -55,5 +56,5 @@ export async function unmount(props) {
...
@@ -55,5 +56,5 @@ export async function unmount(props) {
}
}
export
async
function
update
(
props
)
{
export
async
function
update
(
props
)
{
$hostParams
.
next
(
props
);
$hostParams
.
next
(
props
?.
data
);
}
}
\ No newline at end of file
src/util/index.js
View file @
b796ce39
...
@@ -17,7 +17,7 @@ export const inputWidth = isSzseEnv?360:240;
...
@@ -17,7 +17,7 @@ export const inputWidth = isSzseEnv?360:240;
export
const
ContextPath
=
'/data-govern'
;
export
const
ContextPath
=
'/data-govern'
;
export
const
$hostParams
=
new
BehaviorSubject
(
{}
);
export
const
$hostParams
=
new
BehaviorSubject
(
null
);
const
routeMap
=
{};
const
routeMap
=
{};
export
const
ConvertToRouteMap
=
function
(
routes
,
pPath
,
pRoute
)
{
export
const
ConvertToRouteMap
=
function
(
routes
,
pPath
,
pRoute
)
{
...
...
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