generated from Tahul/vue-composable-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from vu3th/feat/i18n
feat(app): support i18n
- Loading branch information
Showing
9 changed files
with
692 additions
and
97 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
name: 'a' | ||
description: '' | ||
head: | ||
meta: | ||
- name: 'keywords' | ||
content: 'vue-dapp, overview' | ||
--- | ||
|
||
# 概覽 | ||
|
||
<a href="/images/overview.png" target="_blank"><img src="/images/overview.png" alt="overview" /></a> | ||
|
||
|
||
## Wallet & isConnected | ||
|
||
These two states will be frequently used in development. | ||
|
||
The `isConnected` is a [computed](https://vuejs.org/api/reactivity-core.html#computed){:target="_blank"}, and the `wallet` is a [readonly](https://vuejs.org/api/reactivity-core.html#readonly) [reactive](https://vuejs.org/api/reactivity-core.html#reactive){:target="_blank"}. | ||
|
||
The types are defined [here](https://github.com/vu3th/vue-dapp/blob/main/packages/core/src/types/wallet.ts){:target="_blank"}. | ||
|
||
```ts | ||
const { isConnected, wallet } = useVueDapp() | ||
|
||
if(isConnected.value) { | ||
console.log(wallet.status) // 'idle' | 'connecting' | 'connected' | ||
console.log(wallet.error) | ||
console.log(wallet.connectorName) | ||
console.log(wallet.provider) | ||
console.log(wallet.providerInfo) // see EIP-6963 | ||
console.log(wallet.connector) | ||
console.log(wallet.address) | ||
console.log(wallet.chainId) | ||
} | ||
``` | ||
|
||
The wallet comprises 8 properties, each of which can be obtained from the `useVueDapp` as a [computed](https://vuejs.org/api/reactivity-core.html#computed){:target="_blank"}. | ||
|
||
```ts | ||
const { error, chainId } = useVueDapp() | ||
|
||
console.log(error.value) | ||
console.log(chainId.value) | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export default defineI18nConfig(() => ({ | ||
legacy: false, | ||
locale: 'en', | ||
messages: { | ||
en: { | ||
subtitle: 'Empower dapp developers with Vue integration for crypto wallets', | ||
}, | ||
'zh-TW': { | ||
subtitle: '使用 Vue 串接加密貨幣錢包,增進 DApp 開發體驗', | ||
}, | ||
}, | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.