!73 修复table 问题,删除不应提交的文件夹

Merge pull request !73 from 莫名点/next
This commit is contained in:
就眠儀式 2022-05-21 09:24:46 +00:00 committed by Gitee
commit 9c9c31d70f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 104 additions and 19 deletions

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
export default { export default {
name: "LayRate" name: "LayRate",
}; };
</script> </script>
@ -83,14 +83,12 @@ const action = function (index: number, event: any) {
}; };
// //
const showClearIcon = computed( const showClearIcon = computed(() => !props.readonly && props.hasClear);
() => !props.readonly && props.hasClear
);
const clearRate = function () { const clearRate = function () {
tempValue.value = 0; tempValue.value = 0;
currentValue.value = 0; currentValue.value = 0;
emit("clear", currentValue.value); emit("clear", currentValue.value);
} };
</script> </script>
<template> <template>
@ -131,7 +129,11 @@ const clearRate = function(){
</span> </span>
</template> </template>
<template v-if="showClearIcon"> <template v-if="showClearIcon">
<i :class="['layui-icon', 'layui-rate-clear-icon', clearIcon]" @click="clearRate" title="清除评分"></i> <i
:class="['layui-icon', 'layui-rate-clear-icon', clearIcon]"
@click="clearRate"
title="清除评分"
></i>
</template> </template>
</div> </div>
</template> </template>

View File

@ -9,10 +9,11 @@
width: 100%; width: 100%;
background-color: #fff; background-color: #fff;
color: #666; color: #666;
table-layout: fixed;
} }
.layui-table tr { .layui-table tr {
display: flex; // display: flex;
} }
.layui-table th { .layui-table th {
@ -55,7 +56,7 @@
.layui-table td, .layui-table td,
.layui-table th { .layui-table th {
position: relative; position: relative;
padding: 9px 15px; padding: 9px 8px;
min-height: 20px; min-height: 20px;
height: 40px; height: 40px;
line-height: 20px; line-height: 20px;
@ -105,6 +106,7 @@
.layui-table-box { .layui-table-box {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.layui-table-view .layui-table { .layui-table-view .layui-table {
@ -236,9 +238,16 @@
.layui-table-cell, .layui-table-cell,
.layui-table-tool-panel li { .layui-table-tool-panel li {
overflow: hidden;
text-overflow: ellipsis;
// white-space: nowrap;
}
.layui-table-call-ellipsis{
width: 100%;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
cursor: pointer;
} }
.layui-table-tool-panel li { .layui-table-tool-panel li {
@ -355,6 +364,29 @@
position: relative; position: relative;
overflow: auto; overflow: auto;
margin-bottom: -1px; margin-bottom: -1px;
&::-webkit-scrollbar {
width: 13px;
height: 13px;
}
&::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.4);
background-clip: padding-box;
border: 3px solid transparent;
border-radius: 7px;
}
&::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.5);
}
&::-webkit-scrollbar-track {
background-color: transparent;
}
&::-webkit-scrollbar-track:hover {
background-color: #f8fafc;
}
} }
.layui-table-body .layui-none { .layui-table-body .layui-none {

View File

@ -13,6 +13,7 @@ import LayDropdown from "../dropdown/index.vue";
import LayPage from "../page/index.vue"; import LayPage from "../page/index.vue";
import { LayIcon } from "@layui/icons-vue"; import { LayIcon } from "@layui/icons-vue";
import "./index.less"; import "./index.less";
import LayTooltip from "../tooltip/index.vue";
const tableId = uuidv4(); const tableId = uuidv4();
@ -275,7 +276,8 @@ onMounted(() => {
class="layui-table-cell" class="layui-table-cell"
:style="{ :style="{
textAlign: column.align, textAlign: column.align,
flex: column.width ? '0 0 ' + column.width : '1', width: column.width ? column.width : '0',
minWidth: column.minWidth ? column.minWidth : '47px',
}" }"
> >
<span> <span>
@ -340,10 +342,31 @@ onMounted(() => {
class="layui-table-cell" class="layui-table-cell"
:style="{ :style="{
textAlign: column.align, textAlign: column.align,
flex: column.width ? '0 0 ' + column.width : '1', width: column.width ? column.width : '0',
minWidth: column.minWidth
? column.minWidth
: '47px',
whiteSpace: column.ellipsisTooltip
? 'nowrap'
: 'normal',
}" }"
> >
<slot :name="column.customSlot" :data="data"></slot> <lay-tooltip
v-if="column.ellipsisTooltip"
:content="data[column.key]"
>
<div class="layui-table-call-ellipsis">
<slot
:name="column.customSlot"
:data="data"
></slot>
</div>
</lay-tooltip>
<slot
v-else
:name="column.customSlot"
:data="data"
></slot>
</td> </td>
</template> </template>
<!-- Column --> <!-- Column -->
@ -353,10 +376,24 @@ onMounted(() => {
class="layui-table-cell" class="layui-table-cell"
:style="{ :style="{
textAlign: column.align, textAlign: column.align,
flex: column.width ? '0 0 ' + column.width : '1', width: column.width ? column.width : '0',
minWidth: column.minWidth
? column.minWidth
: '47px',
whiteSpace: column.ellipsisTooltip
? 'nowrap'
: 'normal',
}" }"
> >
<span> {{ data[column.key] }} </span> <lay-tooltip
v-if="column.ellipsisTooltip"
:content="data[column.key]"
>
<div class="layui-table-call-ellipsis">
{{ data[column.key] }}
</div>
</lay-tooltip>
<span v-else> {{ data[column.key] }} </span>
</td> </td>
</template> </template>
</template> </template>

View File

@ -35,12 +35,16 @@ export default {
title:"年龄", title:"年龄",
width: "180px", width: "180px",
key:"age" key:"age"
},{
title:"备注",
width: "180px",
key:"remark",
} }
] ]
const dataSource1 = [ const dataSource1 = [
{username:"root", password:"root", age:"18"}, {username:"root", password:"root", age:"18", remark: 'layui - vue谐音类 UI) '},
{username:"woow", password:"woow", age:"20"} {username:"woow", password:"woow", age:"20", remark: 'layui - vue谐音类 UI) 是 一 套 Vue 3.0 的 桌 面 端 组 件 库.layui - vue谐音类 UI) 是 一 套 Vue 3.0 的 桌 面 端 组 件 库.'}
] ]
return { return {
@ -256,26 +260,34 @@ export default {
},{ },{
title:"密码", title:"密码",
customSlot:"password", customSlot:"password",
width:"200px",
key:"password", key:"password",
align: "center" align: "center"
}, },
{ {
title:"年龄", title:"年龄",
width: "180px", width: "200px",
key:"age", key:"age",
sort: true, sort: true,
align: "right" align: "right"
},
{
title:"备注",
width: "180px",
key:"remark",
ellipsisTooltip: true,
} }
,{ ,{
title:"操作", title:"操作",
width:"100px",
customSlot:"operator", customSlot:"operator",
key:"operator" key:"operator"
} }
] ]
const dataSource5 = [ const dataSource5 = [
{id:"1", username:"root", age:"18"}, {id:"1", username:"root",password: '**',age:"18",remark: 'layui - vue谐音类 UI) 是 一 套 Vue 3.0 的 桌 面 端 组 件 库.layui - vue谐音类 UI) 是 一 套 Vue 3.0 的 桌 面 端 组 件 库.'},
{id:"2", username:"woow", age:"20"} {id:"2", username:"woow",password: '**', age:"20",remark: 'layui - vue谐音类 UI) 是 一 套 Vue 3.0 的 桌 面 端 组 件 库.layui - vue谐音类 UI) 是 一 套 Vue 3.0 的 桌 面 端 组 件 库.'}
] ]
const rowClick5 = function(data) { const rowClick5 = function(data) {
@ -358,9 +370,11 @@ export default {
| key | 数据字段 | -- | -- | -- | | key | 数据字段 | -- | -- | -- |
| customSlot | 自定义插槽 | -- | -- | -- | | customSlot | 自定义插槽 | -- | -- | -- |
| width | 宽度 | -- | -- | -- | | width | 宽度 | -- | -- | -- |
| minWidth | 最小宽度 | -- | -- | -- |
| sort | 排序 | -- | -- | -- | | sort | 排序 | -- | -- | -- |
| titleSlot | 标题插槽 | -- | -- | -- | | titleSlot | 标题插槽 | -- | -- | -- |
| align | 对齐方式 | `string` | `left` | `left` `right` `center` | | align | 对齐方式 | `string` | `left` | `left` `right` `center` |
| ellipsisTooltip | 当内容过长被隐藏时显示 tooltip | `boolean` | `false` | `true` `false` |
::: :::