Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
johnson86tw committed Apr 30, 2024
1 parent c733f55 commit 15470e0
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion app/content/zh-TW/overview.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
name: 'a'
description: ''
head:
meta:
Expand Down Expand Up @@ -44,9 +43,33 @@ console.log(error.value)
console.log(chainId.value)
```

## Connect

若你使用 `<VueDappModal>`,下方的程式碼你不太會用到,`<VueDappModal>` 已經幫你把這部分的功能處理好了,以下的說明可以幫助你更了解 Vue Dapp。

```ts
const { connectTo } = useVueDapp()
```

你可以針對特定 connector 進行連線。

```ts
connectTo("BrowserWallet", options)
connectTo("WalletConnect", undefined)
connectTo("CoinbaseWallet", undefined)
```

當你要連線到瀏覽器錢包時,可以選擇使用 EIP-6963 的 RDNS 來連線,或者使用傳統的 `window.ethereum`

當 dapp 在安裝錢包外掛的瀏覽器上開啟時,可以根據 EIP-6963 的協議來取得 provider。而當 dapp 在手機錢包 app 內建的 dapp 瀏覽器上開啟時,則使用 `window.ethereum` 來取得 provider。

```ts
connectTo("BrowserWallet", {
target: "rdns",
rdns: "io.rabby"
})

connectTo("BrowserWallet", {
target: "window.ethereum",
})
```

0 comments on commit 15470e0

Please sign in to comment.