波卡链Substrate (6)SubstrateUI界面
生活随笔
收集整理的這篇文章主要介紹了
波卡链Substrate (6)SubstrateUI界面
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1. 波卡支持基于 React 的 Web 界面
- 預定義的錢包操作、鏈更新、賬戶管理和其他操作
- 完全可定制,可以通過幾個步驟添加任何新 UI
eg.
class BonusSegment extends React.Component {constructor() {super()this.tokenOwner = new Bond}render() {return <Segment style={{ margin: '1em' }} padded><Header as='h2'><Icon name='certificate' /><Header.Content>Bonus tokens<Header.Subheader>Bonus tokens</Header.Subheader></Header.Content></Header><div style={{ paddingBottom: '1em' }}><div style={{ fontSize: 'small' }}>Holder</div><SignerBond bond={this.tokenOwner} /><If condition={this.tokenOwner.ready()} then={<span><Label>Balance<Label.Detail><Pretty value={runtime.bonus.balanceOf(this.tokenOwner)} /></Label.Detail></Label></span>} /></div><TransactButtoncontent="Spend 1 token"icon='game'tx={{sender: this.tokenOwner,call: calls.bonus.transfer(<address for tokens spending>, 1)}}/></Segment>} }按鈕按下
總結
以上是生活随笔為你收集整理的波卡链Substrate (6)SubstrateUI界面的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python 语言教程(4)元组
- 下一篇: 波卡链Substrate (1)生态介绍