feat: connect example

This commit is contained in:
Nik Dement'ev 2020-11-06 18:35:44 +03:00
parent 92032962fc
commit d1aeff786f
No known key found for this signature in database
GPG Key ID: 769B05D57CF16FE2
2 changed files with 21 additions and 4 deletions

View File

@ -11,7 +11,8 @@
"dependencies": {
"@nuxtjs/provider": "https://github.com/tornadocash/provider.git",
"core-js": "^3.6.5",
"nuxt": "^2.14.6"
"nuxt": "^2.14.6",
"vuex": "^3.5.1"
},
"devDependencies": {}
}

View File

@ -3,14 +3,30 @@
<div>
<Logo />
<h1 class="title">
Example
address: {{ getAddress }}
<br>
network: {{ getNetwork }}
</h1>
<button @click="handleConnectProvider">Connect</button>
</div>
</div>
</template>
<script>
export default {}
import { mapActions, mapGetters } from 'vuex'
export default {
computed: {
...mapGetters('provider', ['getAddress', 'getNetwork']),
},
methods: {
...mapActions('provider', ['initProvider']),
handleConnectProvider() {
this.initProvider({ name: 'metamask', network: 'mainnet' })
}
}
}
</script>
<style>
@ -36,7 +52,7 @@ export default {}
sans-serif;
display: block;
font-weight: 300;
font-size: 100px;
font-size: 32px;
color: #35495e;
letter-spacing: 1px;
}