Skip to content

Commit a13d42d

Browse files
committed
fix: dev data get port error
1 parent 1d1dfdb commit a13d42d

3 files changed

Lines changed: 32 additions & 5 deletions

File tree

.changeset/giant-suns-fail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'alita': patch
3+
---
4+
5+
fix: qrcode get port error

packages/alita/src/features/qrcodeterminal.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default (api: IApi) => {
66
api.onDevCompileDone(async ({ isFirstCompile }) => {
77
if (api.userConfig.appType === 'pc') return;
88
if (!isFirstCompile) return;
9-
const port = process.env.PORT || 8000;
9+
const port = api.appData.port || 8000;
1010
const isHTTPS = process.env.HTTPS || api.args?.https;
1111
const lanIp = address.ip();
1212
const protocol = isHTTPS ? 'https' : 'http';
@@ -24,10 +24,6 @@ export default (api: IApi) => {
2424
small: true,
2525
});
2626
}
27-
// TODO: port 要去动态的 port
28-
logger.info(
29-
'这里有一个 bug 取不到动态的 port,所以先保证你运行的 dev 服务是在 8000 端口',
30-
);
3127
logger.event(`Network: ${chalk.cyan(lanUrl)}`);
3228
});
3329
};

packages/flow/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
</For>
1111
```
1212

13+
```ts
14+
{
15+
items.map((item, index) => <div data-index={index()}>{item}</div>)
16+
}
17+
```
18+
1319
## Show
1420

1521
```typescript
@@ -18,6 +24,13 @@
1824
</Show>
1925
```
2026

27+
```ts
28+
{
29+
bool && <div>show!!</div>
30+
!bool && <div>hidden!</div>
31+
}
32+
```
33+
2134
## Switch
2235

2336
```typescript
@@ -31,6 +44,13 @@
3144
</Switch>
3245
```
3346

47+
```ts
48+
{
49+
state.route === 'home' && <Home />
50+
state.route === 'settings' && <Settings />
51+
(state.route !== 'home' && state.route !== 'settings') && <FourOhFour />
52+
}
53+
```
3454
## ErrorBoundary
3555

3656
```typescript
@@ -55,6 +75,12 @@
5575
</ErrorBoundary>
5676
```
5777

78+
## Page
79+
## Header
80+
81+
## Content
82+
## Footer
83+
5884

5985
参考api https://www.solidjs.com/docs/latest/api
6086

0 commit comments

Comments
 (0)