Vue table显示v-if、v-else-if 多层判断写法

第一种写法:

<el-table-column prop="versionStatus" label="标准状态">
			<template slot-scope="scope">					
					<p v-if="scope.row.versionStatus=='1'">
						在用
					</p>
					<p v-else-if="scope.row.versionStatus=='2'">
						过期
					</p>
					<p v-else-if="scope.row.versionStatus=='3'">
						作废
					</p>
					<p v-else-if="scope.row.versionStatus=='4'">
						停用
					</p>					
			</template>
		</el-table-column>

第二种写法,直接用v-if在这里插入图片描述

发布了116 篇原创文章 · 获赞 2 · 访问量 1554

猜你喜欢

转载自blog.csdn.net/weixin_43550562/article/details/104728157