欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

vue中 el-table每個(gè)單元格包含多個(gè)數(shù)據(jù)項(xiàng)處理

 更新時(shí)間:2023年11月11日 11:34:23   作者:還是大劍師蘭特  
vue項(xiàng)目中,我們需要在el-table中顯示數(shù)組數(shù)據(jù),有的時(shí)候,需要在一個(gè)單元格中顯示多條數(shù)據(jù),如何實(shí)現(xiàn)呢,對(duì)vue el-table單元格相關(guān)知識(shí)感興趣的朋友一起看看吧

應(yīng)用場(chǎng)景

vue項(xiàng)目中,我們需要在el-table中顯示數(shù)組數(shù)據(jù),有的時(shí)候,需要在一個(gè)單元格中顯示多條數(shù)據(jù),如何實(shí)現(xiàn)呢?看看下面源代碼,一看便知。

示例效果

示例源代碼(共80行)

/*
* @Author: 大劍師蘭特(xiaozhuanlan),還是大劍師蘭特(CSDN)
* @此源代碼版權(quán)歸大劍師蘭特所有,可供學(xué)習(xí)或商業(yè)項(xiàng)目中借鑒,未經(jīng)授權(quán),不得重復(fù)地發(fā)表到博客、論壇,問(wèn)答,git等公共空間或網(wǎng)站中。
* @Email: 2909222303@qq.com
* @weixin: gis-dajianshi
* @First published in CSDN
* @First published time: 2023-11-11
*/
<template>
	<div class="djs-box">
		<div class="topBox">
			<h3>vue+element UI:一個(gè)表格單元中顯示多條數(shù)據(jù) </h3>
			<div>大劍師蘭特, 還是大劍師蘭特,gis-dajianshi</div>
		</div>
		<div class="cbox">
			<el-table :data="tableData">
				<el-table-column prop="title" label="圖片" width="180">
					<template slot-scope="scope">
						<el-image :src="scope.row.thumbnail_pic_s"></el-image>
					</template>
				</el-table-column>
				<el-table-column prop="date" label="日期" width="180">
				</el-table-column>
				<el-table-column label="混合數(shù)據(jù)">
					<template slot-scope="scope">
						<div>
							<div>文章標(biāo)題:{{scope.row.title}}</div>
							<div>作者姓名:{{scope.row.name}}</div>
							<div>作者郵箱:{{scope.row.email}}</div>
						</div>
					</template>
				</el-table-column>
			</el-table>
		</div>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				tableData: [],
			}
		},
		mounted() {
			this.getdata()
		},
		methods: {
			getdata() {
				let url = "/listdata"
				this.$request(url, {}, "GET")
					.then((res) => {
						this.tableData = res.data.data
						console.log(this.tableData)
					})
			},
		}
	}
</script>
<style scoped>
	.djs-box {
		width: 900px;
		height: 600px;
		margin: 50px auto;
		border: 1px solid seagreen;
	}
	.topBox {
		margin: 0 auto 0px;
		padding: 10px 0;
		background: palevioletred;
		color: #fff;
	}
	.cbox {
		padding: 10px;
	}
</style>

核心代碼

<el-table-column label="混合數(shù)據(jù)">
					<template slot-scope="scope">
						<div>
							<div>文章標(biāo)題:{{scope.row.title}}</div>
							<div>作者姓名:{{scope.row.name}}</div>
							<div>作者郵箱:{{scope.row.email}}</div>
						</div>
					</template>
				</el-table-column>

到此這篇關(guān)于vue中 el-table每個(gè)單元格包含多個(gè)數(shù)據(jù)項(xiàng)處理的文章就介紹到這了,更多相關(guān)vue el-table單元格內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論