Commit 6ef8d853bb4ff348b5a96819cbde40573f3ce8ac
1 parent
be664aa7
rm
Showing
1 changed file
with
0 additions
and
123 deletions
Show diff stats
examples/routers/table.vue deleted
| 1 | -<template> | ||
| 2 | - <div> | ||
| 3 | - <Table border :columns="columns7" :data="data6" disable-highlight></Table> | ||
| 4 | - </div> | ||
| 5 | -</template> | ||
| 6 | -<script> | ||
| 7 | - import etable from '../components/table.vue'; | ||
| 8 | - export default { | ||
| 9 | - components: { etable }, | ||
| 10 | - data () { | ||
| 11 | - return { | ||
| 12 | - columns7: [ | ||
| 13 | -// { | ||
| 14 | -// type: 'expand', | ||
| 15 | -// width: 50, | ||
| 16 | -// render: (h, params) => { | ||
| 17 | -// // return h(etable); | ||
| 18 | -// return h('div', params.row.name) | ||
| 19 | -// } | ||
| 20 | -// }, | ||
| 21 | - { | ||
| 22 | - title: '姓名', | ||
| 23 | - key: 'name', | ||
| 24 | - fixed: 'left', | ||
| 25 | - render: (h, params) => { | ||
| 26 | - return h('div', [ | ||
| 27 | - h('Icon', { | ||
| 28 | - props: { | ||
| 29 | - type: 'person' | ||
| 30 | - } | ||
| 31 | - }), | ||
| 32 | - h('strong', params.row.name) | ||
| 33 | - ]); | ||
| 34 | - } | ||
| 35 | - }, | ||
| 36 | - { | ||
| 37 | - title: '年龄', | ||
| 38 | - key: 'age', | ||
| 39 | - sortable: true | ||
| 40 | - }, | ||
| 41 | - { | ||
| 42 | - title: '地址', | ||
| 43 | - key: 'address' | ||
| 44 | - }, | ||
| 45 | - { | ||
| 46 | - title: '操作', | ||
| 47 | - key: 'action', | ||
| 48 | - width: 150, | ||
| 49 | - align: 'center', | ||
| 50 | - render: (h, params) => { | ||
| 51 | - return h('div', [ | ||
| 52 | - h('Button', { | ||
| 53 | - props: { | ||
| 54 | - type: 'primary', | ||
| 55 | - size: 'small' | ||
| 56 | - }, | ||
| 57 | - style: { | ||
| 58 | - marginRight: '5px' | ||
| 59 | - }, | ||
| 60 | - on: { | ||
| 61 | - click: () => { | ||
| 62 | - this.show(params.index) | ||
| 63 | - } | ||
| 64 | - } | ||
| 65 | - }, '查看'), | ||
| 66 | - h('Button', { | ||
| 67 | - props: { | ||
| 68 | - type: 'error', | ||
| 69 | - size: 'small' | ||
| 70 | - }, | ||
| 71 | - on: { | ||
| 72 | - click: () => { | ||
| 73 | - this.remove(params.index) | ||
| 74 | - } | ||
| 75 | - } | ||
| 76 | - }, '删除') | ||
| 77 | - ]); | ||
| 78 | - } | ||
| 79 | - } | ||
| 80 | - ], | ||
| 81 | - data6: [ | ||
| 82 | - { | ||
| 83 | - name: '王小明', | ||
| 84 | - age: 18, | ||
| 85 | - address: '北京市朝阳区芍药居' | ||
| 86 | - }, | ||
| 87 | - { | ||
| 88 | - name: '张小刚', | ||
| 89 | - age: 25, | ||
| 90 | - address: '北京市海淀区西二旗', | ||
| 91 | - _disableExpand: true | ||
| 92 | - }, | ||
| 93 | - { | ||
| 94 | - name: '李小红', | ||
| 95 | - age: 30, | ||
| 96 | - address: '上海市浦东新区世纪大道', | ||
| 97 | - _expanded: true | ||
| 98 | - }, | ||
| 99 | - { | ||
| 100 | - name: '周小伟', | ||
| 101 | - age: 26, | ||
| 102 | - address: '深圳市南山区深南大道' | ||
| 103 | - } | ||
| 104 | - ] | ||
| 105 | - } | ||
| 106 | - }, | ||
| 107 | - methods: { | ||
| 108 | - show (index) { | ||
| 109 | - this.$Modal.info({ | ||
| 110 | - title: '用户信息', | ||
| 111 | - content: `姓名:${this.data6[index].name}<br>年龄:${this.data6[index].age}<br>地址:${this.data6[index].address}` | ||
| 112 | - }) | ||
| 113 | - }, | ||
| 114 | - remove (index) { | ||
| 115 | - this.data6.splice(index, 1); | ||
| 116 | - }, | ||
| 117 | - expand (row, s) { | ||
| 118 | -// console.log(row); | ||
| 119 | -// console.log(s); | ||
| 120 | - } | ||
| 121 | - } | ||
| 122 | - } | ||
| 123 | -</script> |