Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
johnson86tw committed Aug 28, 2021
1 parent 4f502e7 commit 7e38045
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

vue-dapp/v0.3.0 (2021-08-28)
--------------------------------
- component library available
- useMetamask add provider event

vue-dapp/v0.2.0 (2021-08-24)
--------------------------------
- simple metamask available
39 changes: 32 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,49 @@ Vue3 composable and component library for building Dapps.
- Demo ready to be written using [Vite](https://vitejs.dev/)

## Quick Start

Add dependencies to your main.js:
```javascript
import { defineComponent } from 'vue'
import { useWallet, Wallet } from 'vue-dapp'
import { createApp } from 'vue'
import VueDapp from 'vue-dapp'

const app = createApp({...})
app.use(VueDapp)
```

Add the global component to your App.vue:

```vue
<board />
```

Use wallet or board from your .vue files:

```javascript
import { defineComponent, watch } from 'vue'
import { useWallet, useBoard } from 'vue-dapp'

export default defineComponent({
name: 'App',
setup() {
const { connect, address, fixedBalance, isConnected, disconnect } = useWallet()
const { address, fixedBalance, isConnected, disconnect, error, network } =
useWallet()

const connectMetamask = async () => {
await connect(Wallet.metamask)
}
// open or close the board
const { open, close } = useBoard()

watch(error, (error) => {
if (error) close()
})

return {
network,
error,
address,
isConnected,
fixedBalance,
connectMetamask,
disconnect,
open,
}
},
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-dapp",
"version": "0.2.1",
"version": "0.3.0",
"description": "Vue3 composable and component library for building Dapps.",
"repository": "https://github.com/chnejohnson/vue-dapp",
"bugs": {
Expand Down

0 comments on commit 7e38045

Please sign in to comment.