Skip to content

Commit

Permalink
feat(standalone): add default host/port for connect function (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
Azurewarth0920 authored Mar 1, 2024
1 parent 6ed9dcd commit e8ddfe2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/guide/standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ And connect to host:

```ts
if (process.env.NODE_ENV === 'development')
devtools.connect(/* host, port */)
devtools.connect(/* host (the default is "http://localhost"), port (the default is 8090) */)
```

:::tip Important
Expand Down
2 changes: 1 addition & 1 deletion packages/electron/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { target } from '@vue/devtools-shared'
import { devtools } from '../../devtools-kit/src/index'

export async function connect(host: string, port: number) {
export async function connect(host = 'http://localhost', port = 8098) {
devtools.init()
target.__VUE_DEVTOOLS_HOST__ = host
target.__VUE_DEVTOOLS_PORT__ = port
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/termui/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ globalThis.document = {
getElementById: () => {},
} as any

devtools.connect('http://localhost', 8098)
devtools.connect()

const app = createApp(App)
app.mount()

0 comments on commit e8ddfe2

Please sign in to comment.