This commit is contained in:
2025-11-18 01:01:27 +08:00
parent 57ef842adf
commit 0abe862aff
6 changed files with 566 additions and 24 deletions

View File

@@ -20,6 +20,7 @@ const fetchTest = async () => {
console.log('Fetch Test Data:', data);
}
const dynamicImport = async () => {
// @ts-ignore
const module = await import('http://localhost:4321/test-import.js');
console.log('Dynamically Imported Module:', module);
console.log('Test Function Output:', module.test());
@@ -27,11 +28,16 @@ const dynamicImport = async () => {
}
export const App = () => {
const [appRoutes, setAppRoutes] = useState(getAppRoutes());
useEffect(() => {
setAppRoutes(getAppRoutes());
}, []);
return <div>Web Command App
return <div className='container mx-auto p-4'>
<div>
<textarea className='web-command-textarea border '></textarea>
</div>
Web Command App
<pre onClick={async () => {
await dynamicImport()

View File

@@ -0,0 +1,18 @@
import { useEffect, useState, Fragment } from "react";
export const Refresh = (props: { children: React.ReactNode }) => {
const [tick, setTick] = useState(0);
useEffect(() => {
const listener = () => {
setTick(prevTick => prevTick + 1);
}
document?.addEventListener('refresh', listener);
return () => {
document?.removeEventListener('refresh', listener);
}
}, []) // 空依赖数组是正确的,因为我们使用了函数式更新
return <Fragment key={tick}>{props.children}</Fragment>
}

View File

@@ -0,0 +1,17 @@
---
title: '微信登录方案'
tags: ['首页', '工作台', '登录']
createdAt: 2025-10-28 11:18
updatedAt: 2025-10-28 11:18
---
# 首页描述
微信登录方案,有多个,这里记录关于开发平台登录和公众号登录方案。
## 功能设计
触发登录动作,生成二维码,显示弹窗。
##