Commit b9c95dfc authored by xiaoman's avatar xiaoman

bugfix:钱币列表名称两行显示

parent c9f84579
<template> <template>
<div>
<div v-if="visible">{{ text }}</div>
<div v-else>
<el-tooltip :placement="placement" trigger="click"> <el-tooltip :placement="placement" trigger="click">
<template slot="content"> <template slot="content">
<span class="tooltip-span">{{ text ? text : "" }}</span> <span class="tooltip-span">{{ text ? text : "" }}</span>
...@@ -7,6 +10,9 @@ ...@@ -7,6 +10,9 @@
{{ text ? text : "" }} {{ text ? text : "" }}
</div> </div>
</el-tooltip> </el-tooltip>
</div>
</div>
</template> </template>
<script> <script>
export default { export default {
...@@ -19,6 +25,15 @@ export default { ...@@ -19,6 +25,15 @@ export default {
placement: { placement: {
type: String, type: String,
default: 'top' default: 'top'
},
len: {
type: Number,
default: 21
}
},
computed: {
visible() {
return this.text.length < this.len
} }
} }
} }
......
...@@ -30,7 +30,11 @@ ...@@ -30,7 +30,11 @@
<el-table-column align="center" min-width="110" label="商品编号" prop="id"/> <el-table-column align="center" min-width="110" label="商品编号" prop="id"/>
<el-table-column align="center" min-width="200" label="名称" prop="name" sortable/> <el-table-column align="center" min-width="200" label="名称" prop="name" sortable>
<template slot-scope="scope" >
<Line2Hidden :text="scope.row.name" />
</template>
</el-table-column>
<el-table-column align="center" property="iconUrl" label="图片"> <el-table-column align="center" property="iconUrl" label="图片">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -105,10 +109,11 @@ ...@@ -105,10 +109,11 @@
import { listGoods, deleteGoods } from '@/api/business/goods' import { listGoods, deleteGoods } from '@/api/business/goods'
import BackToTop from '@/components/BackToTop' import BackToTop from '@/components/BackToTop'
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
import Line2Hidden from '@/components/line2Hidden'
export default { export default {
name: 'GoodsList', name: 'GoodsList',
components: { BackToTop, Pagination }, components: { BackToTop, Pagination, Line2Hidden },
data() { data() {
return { return {
list: [], list: [],
......
...@@ -43,8 +43,7 @@ ...@@ -43,8 +43,7 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="钱币描述" prop="extra"> <el-table-column align="center" label="钱币描述" prop="extra">
<template slot-scope="scope" > <template slot-scope="scope" >
<div v-if="scope.row.extra.length <21">{{ scope.row.extra }}</div> <Line2Hidden :text="scope.row.extra" />
<div v-else><Line2Hidden :text="scope.row.extra" /></div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="成交平台" prop="platform" /> <el-table-column align="center" label="成交平台" prop="platform" />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment