From e8ddfe2bbc3ccf788fbccc95f1e353394ed8b46a Mon Sep 17 00:00:00 2001 From: Fan Pei Date: Fri, 1 Mar 2024 19:29:01 +0900 Subject: [PATCH] feat(standalone): add default host/port for connect function (#254) --- docs/guide/standalone.md | 2 +- packages/electron/src/index.ts | 2 +- packages/playground/termui/src/main.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/guide/standalone.md b/docs/guide/standalone.md index 0c0907689..6f974b9a9 100644 --- a/docs/guide/standalone.md +++ b/docs/guide/standalone.md @@ -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 diff --git a/packages/electron/src/index.ts b/packages/electron/src/index.ts index abc653e48..e6a5d7956 100644 --- a/packages/electron/src/index.ts +++ b/packages/electron/src/index.ts @@ -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 diff --git a/packages/playground/termui/src/main.ts b/packages/playground/termui/src/main.ts index ec78974a6..8f7a8f6f6 100644 --- a/packages/playground/termui/src/main.ts +++ b/packages/playground/termui/src/main.ts @@ -8,7 +8,7 @@ globalThis.document = { getElementById: () => {}, } as any -devtools.connect('http://localhost', 8098) +devtools.connect() const app = createApp(App) app.mount()