Skip to content

Commit

Permalink
fix: dev data get port error
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohuoni authored Apr 8, 2022
2 parents 1d1dfdb + a13d42d commit b1f821a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-suns-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'alita': patch
---

fix: qrcode get port error
6 changes: 1 addition & 5 deletions packages/alita/src/features/qrcodeterminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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)}`);
});
};
26 changes: 26 additions & 0 deletions packages/flow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
</For>
```

```ts
{
items.map((item, index) => <div data-index={index()}>{item}</div>)
}
```

## Show

```typescript
Expand All @@ -18,6 +24,13 @@
</Show>
```

```ts
{
bool && <div>show!!</div>
!bool && <div>hidden!</div>
}
```

## Switch

```typescript
Expand All @@ -31,6 +44,13 @@
</Switch>
```

```ts
{
state.route === 'home' && <Home />
state.route === 'settings' && <Settings />
(state.route !== 'home' && state.route !== 'settings') && <FourOhFour />
}
```
## ErrorBoundary

```typescript
Expand All @@ -55,6 +75,12 @@
</ErrorBoundary>
```

## Page
## Header

## Content
## Footer


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

Expand Down

1 comment on commit b1f821a

@vercel
Copy link

@vercel vercel bot commented on b1f821a Apr 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

alita – ./

alita-git-master-alita.vercel.app
next.alitajs.com
alita-alita.vercel.app
alita-pi.vercel.app

Please sign in to comment.