Files
pezkuwi-ui/packages/vue-identicon/src/Demo.ts
T
Jaco Greeff 85a8a3a0ee Add vue-identicon (#178)
* Add vue-identicon

* Remove generated file

* Add links to reactnative & vue identicons

* Update package.json

* Update Jdenticon.vue

* Update Polkadot.vue

* Move deps around

* Empty on error

* Build to build

* ... typo

* Fix vue-identicon doc generation

* Ok, I give up... vuepress and vue packages, no luck

* Swap to TypeScript components (aligning with polkadot-js)

* Expand template with build

* Adjust vue examples

* debump gh-pages dep

* Expand doc. desc.

* Fix vuepress docs generation

* Address CC complexity

* eslint fix (babel config)

* Add Bechball
2019-08-06 13:15:10 +02:00

42 lines
968 B
TypeScript

// Copyright 2017-2019 @polkadot/vue-identicon authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import Vue, { VNode } from 'vue';
import Identicon from './index';
interface Data {
address: string;
size: number;
}
/**
* @name Demo
* @description Demo component
*/
const Demo = Vue.extend({
template: `
<div id="demo">
<Identicon :size="size" :theme="'polkadot'" :value="address" />
<Identicon :size="size" :theme="'substrate'" :value="address" />
<Identicon :size="size" :theme="'beachball'" :value="address" />
<Identicon :size="size" :theme="'empty'" />
</div>
`,
name: 'Demo',
data: function (): Data {
return {
address: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY',
size: 128
};
},
components: {
Identicon
}
});
new Vue({
render: (h): VNode => h(Demo)
}).$mount('#demo');