在element ui中的table里行内的字符串换行
<template slot-scope="scope">
<div v-if="scope.row.problemList">
<div v-for="item in scope.row.problemList.split(';')" :key="item">
<p>{{item}}</p>
</div>
</div>
</template>
使用.split将字符串转换为数组,然后遍历用
来换行。
在vue中v-for需要:key来绑定唯一的值,否则会报错。具体可看vue中关于:key的内容