Compare commits
No commits in common. "e2ee67a88867c2f29c2346c04359508158f2962a" and "559d4d0ecdb23154606b3920723fe8b989210e10" have entirely different histories.
e2ee67a888
...
559d4d0ecd
@ -24,13 +24,15 @@ export const Shadow =(inElement:HTMLElement, inConfig?:TW.TwindUserConfig)=>
|
||||
return ShadowDiv;
|
||||
};
|
||||
|
||||
export default async(inSelector:string, inModulePath:string, inMemberApp="default", inMemberCSS="CSS", inShadow=false):Promise<(()=>void)|false>=>
|
||||
export default async(inSelector:string, inModulePath:string, inMemberApp="default", inMemberCSS="CSS"):Promise<(()=>void)|false>=>
|
||||
{
|
||||
|
||||
if(!inModulePath)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
let dom = document.querySelector(inSelector);
|
||||
if(!dom)
|
||||
{
|
||||
@ -39,15 +41,7 @@ export default async(inSelector:string, inModulePath:string, inMemberApp="defaul
|
||||
}
|
||||
|
||||
const module = await import(inModulePath);
|
||||
|
||||
if(inShadow)
|
||||
{
|
||||
dom = Shadow(dom as HTMLElement, module[inMemberCSS]);
|
||||
}
|
||||
else
|
||||
{
|
||||
TW.install(Configure);
|
||||
}
|
||||
dom = Shadow(dom as HTMLElement, module[inMemberCSS])
|
||||
|
||||
const app = React.createElement(()=> React.createElement(module[inMemberApp], null), null);
|
||||
if(React.render)
|
||||
@ -62,4 +56,5 @@ export default async(inSelector:string, inModulePath:string, inMemberApp="defaul
|
||||
root.render(app);
|
||||
return root.unmount;
|
||||
}
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user