打印/下载
使用
案例

Table 表格

import wmTable from '@/components/form/table'
<wm-table ref="Table" :data="page.list"></wm-table>
  • data: (String) //数据: [{id:val},{id:val}]
  • getVals(): (fun) //获取选中值
  • getRow(name): (fun) //获取单条: name(id || 指定名称)
  • getData(name): (fun) //获取多条: name(id || 指定名称)

Title 标题

import wmTableTitle from '@/components/form/table/title'
<wm-table-title :checked="false">
  <td width="180">UID</td>
</wm-table-title>
  • checked: (Boolean) //全选&不选

Tr 行

import wmTableTr from '@/components/form/table/tr'
<wm-table-tr :value="val.uid">
  <td width="180">UID</td>
</wm-table-tr>
  • value: (Boolean) //值

Form 表单

import wmMain from '@/components/main'
import wmTable from '@/components/table'
import wmTableTitle from '@/components/table/title'
import wmTableTr from '@/components/table/tr'
export default {
  components: {wmMain,wmTable,wmTableTitle,wmTableTr},
  data(){
    return {
      store: this.$store.state,
      page: {list:[], total:0, page:1, limit:15},
    }
  },
  activated(){
    // 表格对象
    const table = this.$refs.Table;
    // 获取选择
    const vals = table.getVals();
    const row = table.getRow('uid');
    const data = table.getData('uid');
  },
}

Html

<template>
  <wm-main>
    <!-- List -->
    <wm-table ref="Table" :data="page.list">
      <wm-table-title>
        <td width="180">UID</td>
      </wm-table-title>
      <wm-table-tr v-for="(val,key) in page.list" :key="key" :value="val.uid">
        <td>{val.uid}</td>
      </wm-table-tr>
    </wm-table>
    <!-- List End -->
  </wm-main>
</template>
{{copy}}