网站首页
云冈区
龙海区
汲滩镇
夏塘镇
雅桥乡
徐闻县
题主描述的全局变量方式示例代码如下: global.ts export const globalState = { name: 'test' }; index.tsx import { createRoot } from 'react-dom/client'; import { globalState } from './global'; const HomePage = () => ( {globalState.name} { globalState.name = value console.log(JSON.stringify(globalState, null, 4); }} /> <…。
咨询在线客服
电话
扫一扫,关注我们