1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| <template> <ul class="listV2"> <li class="listV2_row-title"> <span v-for="(col, index) in fieldList" :key="index" class="listV2_cell ellipsis" :name="col.fieldName"> {{col.fieldLabel}} </span> </li> <div v-if="tableData.length === 0" class="nodata">暂无数据</div> <li v-for="(row, index) in tableData" :key="index" class="listV2_row pointer" @click="rowClickToDetail(row)"> <span v-for="(col, index) in fieldList" :key="index" class="listV2_cell ellipsis" :name="col.fieldName"> <RenderDom :vNode="row[col.fieldName] || '-'"></RenderDom> </span> </li> </ul> </template>
<script> import RenderDom from "./renderDom"; export default { name: 'TableList', props: { tableData: { type: Array, required: true, }, fieldList: { type: Array, required: true, }, align: { type: String, default: 'left', }, }, components: { RenderDom, }, data() { return {} }, computed: {}, watch: {}, created() { }, mounted() { }, methods: {}, updated() { }, beforeDestroy() { }, } </script>
<style lang='less' rel='stylesheet/less' scoped> @import "./index.less"; </style>
|