在本系列的上一篇文章
使用solidity与web3创作一个在线小游戏之四:基于VUE的DAPP,与智能合约的交互_lixiaodog的博客-优快云博客_vue智能合约中我们实现了一个Login页面,在这一章中,我们将实现HOME页面,在其中生成一个动态表格,表格中再嵌套表格,并实现动态的数据绑定。同时还将增加一个drawer来添加数据 。
在VIEW文件夹下添加一个文件home.vue,由于代码较多,以下所有代码引用均为关键片段
实现嵌套表格的代码如下:
<Table
:loading="loading"
border
:columns="columns"
:data="tableData"
>
<template
slot-scope="{row, index}"
slot="action"
>
<Button
style="margin-right: 10px"
@click="addRoom(row, index)"
>添加房间</Button>
</template>
<template
slot-scope="{ row, index }"
slot="roominfo"
>
<Table
:loading="loading"
border
:columns="roomcolumns"
:data="getRoomList(row)"
>
<template
slot-scope="{row, index}"
slot="addoption"
>
<Button
style="margin-