feat: update agreements and refine miniapp layouts and integrations

This commit is contained in:
zhouzhibo committed 2026-10-21 20:33:50 +08:00
1 parent 38fc4187ea
commit 7871114c50
26 files changed
+2018 -120

No files matched your search

+4 -2
View File
@@ -16,11 +16,13 @@ function page(file, { guest = false, bound = false, element = false, routes = []
const exports = {}
vm.runInNewContext(ts.transpileModule(read(file), { compilerOptions: {
module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2019, jsx: ts.JsxEmit.ReactJSX
} }).outputText, { exports, require: id => {
} }).outputText, { exports, process: { env: { TARO_ENV: 'weapp' } }, require: id => {
if (id === 'react/jsx-runtime') return require(id)
if (id === 'react') return { useEffect: () => {}, useMemo: fn => fn(), useRef: value => ({ current: value }),
useState: value => [element && value === 'home' ? 'element' : typeof value === 'function' ? value() : value, () => {}] }
if (id === '@tarojs/taro') return { useDidShow: () => {} }
if (id === '@tarojs/taro') return { useDidShow: () => {}, default: {
getWindowInfo: () => ({ statusBarHeight: 44, safeArea: { top: 44 } })
} }
if (id === '@tarojs/components') return { View: 'View', Text: 'Text', Button: 'Button', Image: 'Image' }
if (id.endsWith('/LoginGate')) return { LoginGate: 'shared-login-gate' }
if (id.endsWith('/tabNavigation')) return { switchMainTab: (target, active) => routes.push([target, active]) }