From a13d42da31b91a9c9becb839d5046e9b0282551f Mon Sep 17 00:00:00 2001 From: xiaohuoni <448627663@qq.com> Date: Fri, 8 Apr 2022 09:26:40 +0800 Subject: [PATCH] fix: dev data get port error --- .changeset/giant-suns-fail.md | 5 ++++ packages/alita/src/features/qrcodeterminal.ts | 6 +---- packages/flow/README.md | 26 +++++++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 .changeset/giant-suns-fail.md diff --git a/.changeset/giant-suns-fail.md b/.changeset/giant-suns-fail.md new file mode 100644 index 00000000..6da6f161 --- /dev/null +++ b/.changeset/giant-suns-fail.md @@ -0,0 +1,5 @@ +--- +'alita': patch +--- + +fix: qrcode get port error diff --git a/packages/alita/src/features/qrcodeterminal.ts b/packages/alita/src/features/qrcodeterminal.ts index 1d6cf25b..7ffc5ebd 100644 --- a/packages/alita/src/features/qrcodeterminal.ts +++ b/packages/alita/src/features/qrcodeterminal.ts @@ -6,7 +6,7 @@ export default (api: IApi) => { api.onDevCompileDone(async ({ isFirstCompile }) => { if (api.userConfig.appType === 'pc') return; if (!isFirstCompile) return; - const port = process.env.PORT || 8000; + const port = api.appData.port || 8000; const isHTTPS = process.env.HTTPS || api.args?.https; const lanIp = address.ip(); const protocol = isHTTPS ? 'https' : 'http'; @@ -24,10 +24,6 @@ export default (api: IApi) => { small: true, }); } - // TODO: port 要去动态的 port - logger.info( - '这里有一个 bug 取不到动态的 port,所以先保证你运行的 dev 服务是在 8000 端口', - ); logger.event(`Network: ${chalk.cyan(lanUrl)}`); }); }; diff --git a/packages/flow/README.md b/packages/flow/README.md index e7241500..1db7a1d8 100644 --- a/packages/flow/README.md +++ b/packages/flow/README.md @@ -10,6 +10,12 @@ ``` + ```ts + { + items.map((item, index) =>
{item}
) + } + ``` + ## Show ```typescript @@ -18,6 +24,13 @@ ``` +```ts +{ + bool &&
show!!
+ !bool &&
hidden!
+} +``` + ## Switch ```typescript @@ -31,6 +44,13 @@ ``` +```ts +{ + state.route === 'home' && + state.route === 'settings' && + (state.route !== 'home' && state.route !== 'settings') && +} +``` ## ErrorBoundary ```typescript @@ -55,6 +75,12 @@ ``` +## Page +## Header + +## Content +## Footer + 参考api https://www.solidjs.com/docs/latest/api