Sign inSign up

yangwao/kodadot

By yangwao

•Updated over 5 years ago

Find more at https://github.com/vue-polkadot/apps

Image
0

294

yangwao/kodadot repository overview

⁠dashboard

⁠Project setup

yarn install
⁠Compiles and hot-reloads for development
yarn run serve
⁠Compiles and minifies for production
yarn run build
⁠Run your tests
yarn run test
⁠Lints and fixes files
yarn run lint
⁠Dev hints

In order to execute some transaction you can use exec located in src/utils/transactionExecutor.ts Usage:

import exec from '@/utils/transactionExecutor';

// arguments: from which account, password for account, which action, array of parameters
this.tx = await exec(this.account, this.password, api.tx.democracy.vote, [referendumId, { aye, conviction }]);
⁠Using reactive properties

Some of the properies on the component needs to be automatically updated (currentBlock)

Usage:

<template>
  <div>{{ currentBlock  }}</div>
</template>

<script lang="ts">
// Skipping imports
export default class Summary extends Vue {
  private currentBlock: any = {};
  private subs: any[] = [];
  
  public async mounted() {
    this.subs.push(await api.derive.chain.bestNumber(value => this.currentBlock = value));
  }

  // Unsubscribe before destroying component
  public beforeDestroy() {
    this.subs.forEach((sub) => sub());
  }
}

</script>
⁠Customize configuration

See Configuration Reference⁠.

Tag summary

Content type

Image

Digest

Size

487.8 MB

Last updated

over 5 years ago

docker pull yangwao/kodadot:develop-latest