Merge branch 'next' into doc-demand

This commit is contained in:
就眠儀式 2022-05-03 17:41:27 +08:00
commit ed0b508a0f
19 changed files with 511 additions and 442 deletions

79
README.zh.md Normal file
View File

@ -0,0 +1,79 @@
## 介绍
<p>
<a href="https://www.npmjs.com/package/@layui/layui-vue"><img src="https://img.shields.io/npm/v/@layui/layui-vue.svg?sanitize=true" alt="Version"></a>
<a href="https://www.npmjs.com/package/@layui/layui-vue"><img src="https://img.shields.io/npm/l/@layui/layui-vue.svg?sanitize=true" alt="License"></a>
<a href="https://travis-ci.org/sentsin/layui"><img alt="Build Status" src="https://img.shields.io/travis/sentsin/layui/master.svg"></a>
<a href="https://coveralls.io/r/sentsin/layui?branch=master"><img alt="Test Coverage" src="https://img.shields.io/coveralls/sentsin/layui/master.svg"></a>
</p>
**[🔶 www.layui-vue.com »](http://www.layui-vue.com)**
layui - vue谐音类 UI) 是 一 套 Vue 3.0 的 桌 面 端 组 件 库.
**Run with code Sandbox.**
[![Edit layui-vue](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/11mvy)
## 功能
你可以用layui vue做的一些事情
* 使用 setup script 编写组件
* 多达 60 个高品质组件
* 提供 Axure 设计资源
* 支持 夜间模式
* 支持 多主题
* 支持 国际化
## 开始使用
使用 npm 安装
```bash
npm i @layui/layui-vue
```
使用前需要将layui vue挂载到vue并引入index.css样式文件
```
import App from './App.vue'
import { createApp } from 'vue'
import layui from '@layui/layui-vue'
import '@layui/layui-vue/lib/index.css'
createApp(App).use(layui).mount('#app')
```
我们在[网站](http://layui-vue.pearadmin.com)上有几个例子。这是第一个让您入门的方法:
```
<template>
<lay-button-container>
<lay-button>Hello Word</lay-button>
</lay-button-container>
</template>
```
## 反馈
欢迎在[提交问题](https://github.com/layui-vue/layui-vue/issues/new)上向我们反馈。欢迎功能请求。如果您想贡献,请查看[快速指南](./CONTRIBUTING.md)
如果您有什么想聊的,请随时加入我们的[Gitter chat](https://gitter.im/layui-vue/community)
## 构建过程
- `build` 打包组件库
请看一下[贡献指南](./CONTRIBUTING.md),以获得关于如何构建应用程序的详细过程以及排除故障的信息。
## 贡献者
这个项目遵循[所有贡献者](https://github.com/layui-vue/layui-vue/graphs/contributors)规范,感谢这些[出色的贡献者](https://github.com/layui-vue/layui-vue/graphs/contributors)。
<a href="https://github.com/layui-vue/layui-vue/graphs/contributors">
<img src="https://contrib.rocks/image?repo=layui-vue/layui-vue" />
</a>
## 开源许可
Layui vue是基于[MIT协议](https://opensource.org/licenses/MIT)提供。

View File

@ -1,6 +1,6 @@
{ {
"name": "@layui/layui-vue", "name": "@layui/layui-vue",
"version": "1.0.5-alpha.1", "version": "1.0.6",
"author": "就眠儀式", "author": "就眠儀式",
"license": "MIT", "license": "MIT",
"description": "a component library for Vue 3 base on layui-vue", "description": "a component library for Vue 3 base on layui-vue",
@ -32,7 +32,7 @@
"dependencies": { "dependencies": {
"@layui/icons-vue": "^1.0.8", "@layui/icons-vue": "^1.0.8",
"@layui/layer-vue": "^1.3.13", "@layui/layer-vue": "^1.3.13",
"@vueuse/core": "^8.3.0", "@vueuse/core": "^8.3.1",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"async-validator": "^4.0.7", "async-validator": "^4.0.7",
"cropperjs": "^1.5.12", "cropperjs": "^1.5.12",
@ -40,7 +40,7 @@
"dayjs": "^1.11.0", "dayjs": "^1.11.0",
"evtd": "^0.2.3", "evtd": "^0.2.3",
"uuid": "^8.3.2", "uuid": "^8.3.2",
"vue-i18n": "^9.2.0-beta.34" "vue-i18n": "^9.1.9"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.17.9", "@babel/core": "^7.17.9",

View File

@ -1,44 +1,34 @@
.scrollbar-box { .layui-scroll {
height: 100%; height: 100%;
overflow: hidden !important; overflow: hidden !important;
} }
.scrollbar-y { .layui-scroll-y {
position: relative; position: relative;
height: 100%; height: 100%;
.scroll-wrap {
.layui-scroll-wrap {
height: 100%; height: 100%;
overflow-y: scroll; overflow-y: scroll;
scrollbar-width: none; /* firefox */ scrollbar-width: none;
-ms-overflow-style: none; -ms-overflow-style: none;
} }
.scrollbar-track { .layui-scroll-track {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
border-radius: 8px; border-radius: 8px;
z-index: 20; z-index: 20;
.scrollbar-thumb { .layui-scroll-thumb {
margin: 0 auto; margin: 0 auto;
border-radius: 6px; border-radius: 6px;
cursor: default; cursor: default;
} }
} }
} }
.scrollbar-y ::-webkit-scrollbar {
.layui-scroll-y ::-webkit-scrollbar {
display: none; display: none;
} }
//移动端隐藏自定义滚动条
.hide.scrollbar-box .scrollbar-track {
display: none;
}
//移动端显示原生滑块
.hide.scrollbar-box .scrollbar-y ::-webkit-scrollbar {
display: block;
}
.hide.scrollbar-box .scrollbar-y .scroll-wrap {
scrollbar-width: auto;
-ms-overflow-style: scrollbar;
}

View File

@ -1,32 +1,28 @@
<template> <template>
<div <div
class="scrollbar-box" class="layui-scroll"
:class="{ hide: winWidth < 500 }" :class="{ hide: data.winWidth < 500 }"
:style="{ height: height }" :style="{ height: height }"
> >
<div class="scrollbar-y"> <div class="layui-scroll-y">
<div ref="scrollRef" class="scroll-wrap" @scroll="onMosewheel"> <div ref="scrollRef" class="layui-scroll-wrap" @scroll="onMosewheel">
<slot></slot> <slot></slot>
</div> </div>
<div <div
ref="barRef" ref="barRef"
class="scrollbar-track" class="layui-scroll-track"
:style="{ :style="{
backgroundColor: heightPre == 1 ? 'rgba(0,0,0,0)' : slotColor, backgroundColor: data.heightPre == 1 ? 'rgba(0,0,0,0)' : trackColor,
}" }"
> >
<!--
没有滑块方式背景色透明使用v-show窗口变大滑块不出现所以使用背景色控制
backgroundColor: heightPre == 1 ? 'rgba(0,0,0,0)' : scrollColor,
-->
<div <div
:style="{ :style="{
height: barHeight + 'px', height: data.barHeight + 'px',
width: scrollWidth + 'px', width: thumbWidth + 'px',
transform: 'translateY(' + translateY + 'px)', transform: 'translateY(' + data.translateY + 'px)',
backgroundColor: heightPre == 1 ? 'rgba(0,0,0,0)' : scrollColor, backgroundColor: data.heightPre == 1 ? 'rgba(0,0,0,0)' : thumbColor,
}" }"
class="scrollbar-thumb" class="layui-scroll-thumb"
@mousedown.stop.prevent="moveStart" @mousedown.stop.prevent="moveStart"
></div> ></div>
</div> </div>
@ -34,202 +30,199 @@
</div> </div>
</template> </template>
<script> <script lang="ts">
import "./index.less"; export default {
import {
defineComponent,
toRefs,
onMounted,
nextTick,
reactive,
onUnmounted,
} from "vue";
export default defineComponent({
name: "LayScroll", name: "LayScroll",
props: { };
height: { </script>
type: String,
default: "100%", <script lang="ts" setup>
}, import "./index.less";
slotColor: { import { toRefs, onMounted, nextTick, reactive, onUnmounted, ref } from "vue";
// :slotColor="'red'"
type: String, export interface LayScrollProps {
default: "rgba(0,0,0,0)", height?: string;
}, trackColor?: string;
scrollColor: { thumbColor?: string;
// :scrollColor="'red'" thumbWidth?: number;
type: String, }
default: "#eeeeee",
}, const props = withDefaults(defineProps<LayScrollProps>(), {
scrollWidth: { height: "100%",
// :scrollWidth="7" trackColor: "rgba(0,0,0,0)",
type: Number, thumbColor: "#eeeeee",
default: 6, thumbWidth: 6,
}, });
},
setup(props, ctx) { const emit = defineEmits(["arrive"]);
const data = reactive({
scrollRef: null, // const scrollRef = ref<HTMLElement | null>(null);
barRef: null, // const barRef = ref<HTMLElement | null>(null);
translateY: 0, //
heightPre: 0, // const data = reactive({
barHeight: 0, // translateY: 0, //
winWidth: document.body.clientWidth, // heightPre: 0, //
}); barHeight: 0, //
let time = null; // winWidth: document.body.clientWidth, //
let isMove = false; // });
let moveClientY = 0; //
let trackHeight = 0; // let time = null; //
let wrapHeight = 0; // let isMove = false; //
let wrapContentHeight = 0; // let moveClientY = 0; //
let trackHeight = 0; //
// let wrapHeight = 0; //
onMounted(() => { let wrapContentHeight = 0; //
monitorWindow(); //
monitorScrollBar(); // //
nextTick(() => { onMounted(() => {
//dom monitorWindow(); //
calculationLength(); // monitorScrollBar(); //
}); nextTick(() => {
}); //dom
// calculationLength(); //
onUnmounted(() => { });
window.clearInterval(time); });
time = null;
}); //
// onUnmounted(() => {
const monitorWindow = function () { window.clearInterval(time);
let time; // time = null;
window.addEventListener("resize", () => { });
data.winWidth = document.body.clientWidth; //
clearTimeout(time); //
time = setTimeout(() => { const monitorWindow = function () {
//500 let time; //
// console.log(""); window.addEventListener("resize", () => {
initScrollListner(); data.winWidth = document.body.clientWidth; //
}, 500); clearTimeout(time);
}); time = setTimeout(() => {
}; //500
// console.log("");
// initScrollListner();
const monitorScrollBar = function () { }, 500);
var monitorUl = data.scrollRef.children[0]; });
// var monitorDiv= document; // document };
let MutationObserver =
window.MutationObserver || //
window.WebKitMutationObserver || const monitorScrollBar = function () {
window.MozMutationObserver; var monitorUl = scrollRef.value.children[0];
let observer = new MutationObserver(function (mutations) { // var monitorDiv= document; // document
// console.log(""); let MutationObserver =
initScrollListner(); window.MutationObserver ||
}); // @ts-ignore
window.WebKitMutationObserver ||
// childList // @ts-ignore
// window.MozMutationObserver;
observer.observe(monitorUl, { let observer = new MutationObserver(function (mutations) {
attributes: true, // console.log("");
childList: true, initScrollListner();
}); });
};
//
// observer.observe(monitorUl, {
const calculationLength = function () { attributes: true,
// initScrollListner childList: true,
// dom });
// 10 };
time = setInterval(() => {
// //
initScrollListner(); const calculationLength = function () {
}, 50); // initScrollListner
// 500 // dom
setTimeout(() => { // 10
window.clearInterval(time); time = setInterval(() => {
time = null; //
}, 2000); initScrollListner();
}; }, 50);
// // 500
const initScrollListner = function () { setTimeout(() => {
let scroll = data.scrollRef; window.clearInterval(time);
let bar = data.barRef; time = null;
// scroll }, 2000);
if (scroll) { };
wrapContentHeight = scroll.scrollHeight;
wrapHeight = scroll.clientHeight; //
trackHeight = bar.clientHeight; const initScrollListner = function () {
// console.log(wrapContentHeight ,wrapHeight); let scroll = scrollRef.value;
// / 100 150 let bar = barRef.value;
data.heightPre = wrapHeight / wrapContentHeight; // scroll
// if (scroll) {
data.barHeight = data.heightPre * trackHeight; wrapContentHeight = scroll.scrollHeight;
} wrapHeight = scroll.clientHeight;
}; trackHeight = bar.clientHeight;
// // console.log(wrapContentHeight ,wrapHeight);
const onMosewheel = function (e) { // / 100 150
// scrollTop data.heightPre = wrapHeight / wrapContentHeight;
// offsetHeight //
// scrollHeight data.barHeight = data.heightPre * trackHeight;
// data.translateY }
data.translateY = e.target.scrollTop * data.heightPre; };
if (data.translateY == 0) {
// //
arrive("top"); const onMosewheel = function (e) {
} else if ( // scrollTop
e.target.scrollTop + e.target.offsetHeight == // offsetHeight
e.target.scrollHeight // scrollHeight
) { // data.translateY
// + == data.translateY = e.target.scrollTop * data.heightPre;
arrive("bottom"); if (data.translateY == 0) {
} //
}; arrive("top");
// } else if (
const arrive = function name(tb) { e.target.scrollTop + e.target.offsetHeight ==
ctx.emit("arrive", tb); e.target.scrollHeight
}; ) {
// // + ==
const moveStart = function (e) { arrive("bottom");
isMove = true; }
// clientYy };
// data.translateY
// moveClientY //
moveClientY = e.clientY - data.translateY; const arrive = function name(tb) {
moveTo(); // emit("arrive", tb);
moveEnd(); // };
};
// thumbscrollTop //
const moveTo = function () { const moveStart = function (e) {
document.onmousemove = (e) => { isMove = true;
// // clientYy
if (isMove) { // data.translateY
// // moveClientY
if (e.clientY - moveClientY > trackHeight - data.barHeight) { moveClientY = e.clientY - data.translateY;
// translateY moveTo(); //
data.translateY = trackHeight - data.barHeight; moveEnd(); //
} else if (e.clientY - moveClientY < 0) { };
// translateY
data.translateY = 0; // thumbscrollTop
} else { const moveTo = function () {
// document.onmousemove = (e) => {
data.translateY = e.clientY - moveClientY; //
} if (isMove) {
// //
data.scrollRef.scrollTop = data.translateY / data.heightPre; if (e.clientY - moveClientY > trackHeight - data.barHeight) {
} // translateY
}; data.translateY = trackHeight - data.barHeight;
}; } else if (e.clientY - moveClientY < 0) {
// // translateY
const moveEnd = function () { data.translateY = 0;
document.onmouseup = (e) => { } else {
if (isMove) { //
isMove = false; data.translateY = e.clientY - moveClientY;
} }
}; //
}; scrollRef.value.scrollTop = data.translateY / data.heightPre;
}
return { };
...toRefs(data), };
onMosewheel,
moveStart, //
}; const moveEnd = function () {
}, document.onmouseup = (e) => {
}); if (isMove) {
isMove = false;
}
};
};
let dataRef = toRefs(data);
</script> </script>

View File

@ -1,3 +1,9 @@
<script lang="ts">
export default {
name: "StandardVue",
};
</script>
<script setup lang="ts"> <script setup lang="ts">
import { Ref, ref } from "vue"; import { Ref, ref } from "vue";
import { on, off } from "evtd"; import { on, off } from "evtd";
@ -11,6 +17,7 @@ interface Prop {
min?: number; min?: number;
max?: number; max?: number;
} }
const props = withDefaults(defineProps<Prop>(), { const props = withDefaults(defineProps<Prop>(), {
disabled: false, disabled: false,
val: 0, val: 0,

View File

@ -1,8 +1,15 @@
<script lang="ts">
export default {
name: "StandardRange",
};
</script>
<script setup lang="ts"> <script setup lang="ts">
import { ref, toRef, Ref } from "vue"; import { ref, toRef, Ref } from "vue";
import { on, off } from "evtd"; import { on, off } from "evtd";
import { throttle } from "./utils/index"; import { throttle } from "./utils/index";
import LayTooltip from "../tooltip/index.vue"; import LayTooltip from "../tooltip/index.vue";
interface Prop { interface Prop {
rangeValue: Array<number>; rangeValue: Array<number>;
disabled?: boolean; disabled?: boolean;
@ -17,6 +24,7 @@ const props = withDefaults(defineProps<Prop>(), {
max: 100, max: 100,
disabled: false, disabled: false,
}); });
let rv = toRef(props, "rangeValue"); let rv = toRef(props, "rangeValue");
const moveAction = throttle(rangeMove); const moveAction = throttle(rangeMove);

View File

@ -1,3 +1,9 @@
<script lang="ts">
export default {
name: "Vertical",
};
</script>
<script setup lang="ts"> <script setup lang="ts">
import { Ref, ref } from "vue"; import { Ref, ref } from "vue";
import { on, off } from "evtd"; import { on, off } from "evtd";
@ -11,6 +17,7 @@ interface Prop {
min?: number; min?: number;
max?: number; max?: number;
} }
const props = withDefaults(defineProps<Prop>(), { const props = withDefaults(defineProps<Prop>(), {
disabled: true, disabled: true,
val: 0, val: 0,

View File

@ -1,8 +1,15 @@
<script lang="ts">
export default {
name: "VerticalRange",
};
</script>
<script setup lang="ts"> <script setup lang="ts">
import { ref, toRef, Ref } from "vue"; import { ref, toRef, Ref } from "vue";
import { on, off } from "evtd"; import { on, off } from "evtd";
import { throttle } from "./utils/index"; import { throttle } from "./utils/index";
import LayTooltip from "../tooltip/index.vue"; import LayTooltip from "../tooltip/index.vue";
interface Prop { interface Prop {
rangeValue: Array<number>; rangeValue: Array<number>;
disabled?: boolean; disabled?: boolean;

View File

@ -17,7 +17,7 @@
.layui-slider-btn-v { .layui-slider-btn-v {
width: 12px; width: 12px;
height: 12px; height: 12px;
background-color: var(--global-back-color); background-color: white;
position: absolute; position: absolute;
border: 2px solid var(--global-primary-color); border: 2px solid var(--global-primary-color);
border-radius: 50%; border-radius: 50%;
@ -73,7 +73,7 @@
.layui-slider-vertical-btn { .layui-slider-vertical-btn {
width: 12px; width: 12px;
height: 12px; height: 12px;
background-color: var(--global-back-color); background-color: white;
position: absolute; position: absolute;
border: 2px solid var(--global-primary-color); border: 2px solid var(--global-primary-color);
border-radius: 50%; border-radius: 50%;

View File

@ -1,6 +1,12 @@
<script lang="ts">
export default {
name: "LaySlider",
};
</script>
<script setup lang="ts"> <script setup lang="ts">
import { Ref, toRef } from "vue";
import "./index.less"; import "./index.less";
import { Ref, toRef } from "vue";
import StandardVue from "./Standard.vue"; import StandardVue from "./Standard.vue";
import StandardRange from "./StandardRange.vue"; import StandardRange from "./StandardRange.vue";
import Vertical from "./Vertical.vue"; import Vertical from "./Vertical.vue";

View File

@ -1,168 +0,0 @@
<template>
<div id="sliderVerify" class="slider-item">
<div class="slider-bg layui-bg-green"></div>
<div class="slider-text">
{{ prototype.isOk == false ? prototype.text : prototype.success }}
</div>
<div
:class="
prototype.isOk == false
? 'slider-btn layui-icon layui-icon-next'
: 'slider-btn layui-icon layui-icon-ok-circle slider-btn-success'
"
@mousedown.stop="down"
></div>
</div>
</template>
<script setup lang="ts">
import { reactive, ref, defineProps } from "vue";
import { on, off } from "evtd";
import { throttle, handle_select } from "./utils/index";
interface Prop {
disabled?: boolean;
bg?: string;
text?: string;
end?: string;
success?: Function;
}
const props = withDefaults(defineProps<Prop>(), {
disabled: false,
});
//
const prototype = reactive({
isOk: false,
bg: props.bg, //
text: props.text ? props.text : "请拖动滑块验证",
success: props.end ? props.end : "验证通过",
ok: props.success,
});
//
/* prototype.isMobile = function () {
return (
device.os == "ios" ||
device.os == "android" ||
device.android ||
device.ios ||
(device.weixin && typeof device.weixin === Boolean)
);
}; */
const moveAction = throttle(move);
let distance;
let downX;
//
const down = function (e) {
e = e || window.event;
console.log(e.path);
distance = e.path[1].offsetWidth - e.path[0].offsetWidth;
//
downX = e.clientX;
on("selectstart", window, handle_select, { once: true });
on("mouseup", window, stop);
on("mousemove", window, moveAction);
};
//
function move(e) {
e = e || window.event;
let moveX = e.clientX;
// -
let offsetX = moveX - downX;
if (offsetX > 0) {
e.path[0].style.left = offsetX + "px";
e.path[1].childNodes[0].style.width = offsetX + "px";
// >=
if (offsetX >= distance) {
prototype.isOk = true;
//
off("mousedown", window, down);
off("mousemove", window, moveAction);
//
if (prototype.ok) prototype.ok();
}
}
}
//
const stop = function (e) {
//
if (prototype.isOk === true) {
return;
} else {
e.path[0].style.left = 0;
e.path[1].childNodes[0].style.width = 0;
}
//
off("selectstart", document, handle_select);
off("mouseup", window, stop);
off("mousemove", window, moveAction);
};
</script>
<style scoped>
.slider-item {
height: 38px;
line-height: 38px;
background-color: #d0d0d0;
position: relative;
border: 1px solid white;
}
.slider-bg {
position: absolute;
width: 40px;
height: 100%;
z-index: 100;
}
.slider-btn {
width: 40px;
height: 96%;
position: absolute;
border: 1px solid #ccc;
cursor: move;
text-align: center;
background-color: #fff;
user-select: none;
color: #666;
z-index: 120;
}
.slider-btn:hover {
cursor: pointer;
}
.slider-btn-success {
font-size: 22px;
}
.slider-text {
position: absolute;
text-align: center;
width: 100%;
height: 100%;
user-select: none;
font-size: 14px;
color: #fff;
z-index: 120;
}
.slider-error {
animation: glow 800ms ease-out infinite alternate;
}
@keyframes glow {
0% {
border-color: #e6e6e6;
}
100% {
border-color: #ff5722;
}
}
</style>

View File

@ -270,12 +270,12 @@ onMounted(() => {
</th> </th>
<template v-for="column in columns" :key="column"> <template v-for="column in columns" :key="column">
<th <th
v-if="tableColumnKeys.includes(column.key)"
class="layui-table-cell" class="layui-table-cell"
:style="{ :style="{
textAlign: column.align, textAlign: column.align,
flex: column.width ? '0 0 ' + column.width : '1', flex: column.width ? '0 0 ' + column.width : '1',
}" }"
v-if="tableColumnKeys.includes(column.key)"
> >
<span> <span>
<template v-if="column.titleSlot"> <template v-if="column.titleSlot">
@ -285,10 +285,11 @@ onMounted(() => {
{{ column.title }} {{ column.title }}
</template> </template>
</span> </span>
<!-- 插槽 -->
<span <span
v-if="column.sort" v-if="column.sort"
class="layui-table-sort layui-inline" class="layui-table-sort layui-inline"
lay-sort="" lay-sort
> >
<i <i
@click.stop="sortTable($event, column.key, 'asc')" @click.stop="sortTable($event, column.key, 'asc')"

View File

@ -116,6 +116,11 @@ a:hover {
color: #777; color: #777;
} }
a cite {
font-style: normal;
*cursor: pointer;
}
.layui-border-box, .layui-border-box,
.layui-border-box * { .layui-border-box * {
box-sizing: border-box; box-sizing: border-box;

View File

@ -10,7 +10,7 @@
<lay-icon :type="iconType" size="40"> </lay-icon> <lay-icon :type="iconType" size="40"> </lay-icon>
</lay-button> </lay-button>
</div> </div>
<lay-scroll :scrollWidth="0"> <lay-scroll :thumbWidth="0">
<ul> <ul>
<li <li
v-for="(anchor, index) in anchorList" v-for="(anchor, index) in anchorList"

View File

@ -40,9 +40,9 @@ export default {
| 属性 | 描述 | 可选值 | | 属性 | 描述 | 可选值 |
| ----------- | -------- | ------ | | ----------- | -------- | ------ |
| height | 高度 | -- | | height | 高度 | -- |
| scrollWidth | 滑块宽度 | -- | | thumbWidth | 滑块宽度 | -- |
| scrollColor | 滑块颜色 | -- | | thumbColor | 滑块颜色 | -- |
| slotColor | 滑槽颜色 | -- | | trackColor | 滑槽颜色 | -- |
::: :::

View File

@ -167,7 +167,6 @@ export default {
::: :::
::: title 开启排序 ::: title 开启排序
::: :::
@ -311,15 +310,15 @@ export default {
::: table ::: table
| 属性 | 描述 | 类型 | 默认值 | 可选值 | | 属性 | 描述 | 类型 | 默认值 | 可选值 |
| -------------------- | ----------------------------- | ---- | ------ | -------------- | | -------------------- | ----------------------------- | --------- | ------- | -------------- |
| columns | 列配置 - [更多](#tableColumn) | -- | -- | -- | | columns | 列配置 - [更多](#tableColumn) | -- | -- | -- |
| dataSource | 数据源 | -- | -- | -- | | dataSource | 数据源 | -- | -- | -- |
| checkbox | 开启复选框 | `boolean` | `false` | `true` `false` | | checkbox | 开启复选框 | `boolean` | `false` | `true` `false` |
| id | 主键 | `string` | -- | -- | | id | 主键 | `string` | -- | -- |
| v-model:selectedKeys | 选中项 | -- | -- | -- | | v-model:selectedKeys | 选中项 | -- | -- | -- |
| default-toolbar | 工具栏 | `boolean` | `false` | `true` `false` | | default-toolbar | 工具栏 | `boolean` | `false` | `true` `false` |
| size | 尺寸 | `string` | `md` | `lg` `md` `sm` | | size | 尺寸 | `string` | `md` | `lg` `md` `sm` |
::: :::
@ -353,18 +352,17 @@ export default {
::: table ::: table
| 插槽 | 描述 | 类型 | 默认值 | 可选值 | | 插槽 | 描述 | 类型 | 默认值 | 可选值 |
| ---------- | ---------- | ---- |---- |---- | | ---------- | ---------- | -------- | ------ | ----------------------- |
| title | 列标题 | -- |-- |-- | | title | 列标题 | -- | -- | -- |
| key | 数据字段 | -- |-- |-- | | key | 数据字段 | -- | -- | -- |
| customSlot | 自定义插槽 | -- |-- |-- | | customSlot | 自定义插槽 | -- | -- | -- |
| width | 宽度 | -- |-- |-- | | width | 宽度 | -- | -- | -- |
| sort | 排序 | -- |-- |-- | | sort | 排序 | -- | -- | -- |
| titleSlot | 标题插槽 | -- |-- |-- | | titleSlot | 标题插槽 | -- | -- | -- |
| align | 对齐方式 | `string` | `left` | `left` `right` `center` | | align | 对齐方式 | `string` | `left` | `left` `right` `center` |
::: :::
::: previousNext table ::: previousNext table
::: :::

View File

@ -12,7 +12,38 @@
<lay-timeline> <lay-timeline>
<lay-timeline-item title="1.0.x"> <lay-timeline-item title="1.0.x">
<ul> <ul>
<a name="1-0-4"> </a> <a name="1-0-6"></a>
<li>
<h3>1.0.6 <span class="layui-badge-rim">2022-05-02</span></h3>
<ul>
<li>[修复] scroll 组件 height 属性必填警告。</li>
<li>[修复] scroll 组件 slotColor 属性必填警告。</li>
<li>[修复] scroll 组件 scrollColor 属性必填警告。</li>
<li>[修复] scroll 组件 scrollWidth 属性必填警告。</li>
<li>[修正] scroll 组件 slotColor 属性为 thackColor。</li>
<li>[修正] scroll 组件 scrollColor 属性为 thumbColor。</li>
<li>[修正] scroll 组件 scrollWidth 属性为 thumbWidth。</li>
<li>[升级] vueuse/core 8.3.1。</li>
<li>[升级] vue-i18n 9.1.9。</li>
</ul>
</li>
</ul>
<ul>
<a name="1-0-5"></a>
<li>
<h3>1.0.5 <span class="layui-badge-rim">2022-05-01</span></h3>
<ul>
<li>[新增] dropdown 组件 context-menu 属性。</li>
<li>[修复] layer 组件 tooltip 组件 index 层级冲突。</li>
<li>[修复] table 组件 columns 宽度超出 table-box 错位。</li>
<li>[修复] table 组件 selected-keys 属性 deep 监听。</li>
<li>[修复] slider 组件 btn 背景色。</li>
<li>[修复] upload 组件 url 失效。</li>
</ul>
</li>
</ul>
<ul>
<a name="1-0-4"></a>
<li> <li>
<h3>1.0.4 <span class="layui-badge-rim">2022-04-21</span></h3> <h3>1.0.4 <span class="layui-badge-rim">2022-04-21</span></h3>
<ul> <ul>
@ -33,7 +64,7 @@
</li> </li>
</ul> </ul>
<ul> <ul>
<a name="1-0-3"> </a> <a name="1-0-3"></a>
<li> <li>
<h3>1.0.3 <span class="layui-badge-rim">2022-04-17</span></h3> <h3>1.0.3 <span class="layui-badge-rim">2022-04-17</span></h3>
<ul> <ul>
@ -69,7 +100,7 @@
</li> </li>
</ul> </ul>
<ul> <ul>
<a name="1-0-1"> </a> <a name="1-0-1"></a>
<li> <li>
<h3>1.0.1 <span class="layui-badge-rim">2022-04-06</span></h3> <h3>1.0.1 <span class="layui-badge-rim">2022-04-06</span></h3>
<ul> <ul>

View File

@ -43,7 +43,7 @@
rel="nofollow" rel="nofollow"
class="site-star" class="site-star"
> >
<i class="layui-icon"></i> Star <cite id="getStars">746</cite> <i class="layui-icon"></i> Star <cite id="getStars">863</cite>
</a> </a>
<a <a
href="https://gitee.com/layui-vue" href="https://gitee.com/layui-vue"

113
pnpm-lock.yaml generated
View File

@ -55,7 +55,7 @@ importers:
'@vitejs/plugin-vue': ^2.3.1 '@vitejs/plugin-vue': ^2.3.1
'@vue/compiler-sfc': ^3.2.33 '@vue/compiler-sfc': ^3.2.33
'@vue/server-renderer': ^3.2.33 '@vue/server-renderer': ^3.2.33
'@vueuse/core': ^8.3.0 '@vueuse/core': ^8.3.1
animate.css: ^4.1.1 animate.css: ^4.1.1
async-validator: ^4.0.7 async-validator: ^4.0.7
cropperjs: ^1.5.12 cropperjs: ^1.5.12
@ -68,11 +68,11 @@ importers:
typescript: ^4.6.3 typescript: ^4.6.3
uuid: ^8.3.2 uuid: ^8.3.2
vite: 2.9.2 vite: 2.9.2
vue-i18n: ^9.2.0-beta.34 vue-i18n: ^9.1.9
dependencies: dependencies:
'@layui/icons-vue': link:../icons '@layui/icons-vue': link:../icons
'@layui/layer-vue': link:../layer '@layui/layer-vue': link:../layer
'@vueuse/core': 8.3.0_vue@3.2.33 '@vueuse/core': 8.3.1_vue@3.2.33
animate.css: 4.1.1 animate.css: 4.1.1
async-validator: 4.0.7 async-validator: 4.0.7
cropperjs: 1.5.12 cropperjs: 1.5.12
@ -80,7 +80,7 @@ importers:
dayjs: 1.11.0 dayjs: 1.11.0
evtd: 0.2.3 evtd: 0.2.3
uuid: 8.3.2 uuid: 8.3.2
vue-i18n: 9.2.0-beta.34_vue@3.2.33 vue-i18n: 9.1.9_vue@3.2.33
devDependencies: devDependencies:
'@babel/core': 7.17.9 '@babel/core': 7.17.9
'@babel/preset-env': 7.16.11_@babel+core@7.17.9 '@babel/preset-env': 7.16.11_@babel+core@7.17.9
@ -2554,6 +2554,18 @@ packages:
resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==}
dev: true dev: true
/@intlify/core-base/9.1.9:
resolution: {integrity: sha512-x5T0p/Ja0S8hs5xs+ImKyYckVkL4CzcEXykVYYV6rcbXxJTe2o58IquSqX9bdncVKbRZP7GlBU1EcRaQEEJ+vw==}
engines: {node: '>= 10'}
dependencies:
'@intlify/devtools-if': 9.1.9
'@intlify/message-compiler': 9.1.9
'@intlify/message-resolver': 9.1.9
'@intlify/runtime': 9.1.9
'@intlify/shared': 9.1.9
'@intlify/vue-devtools': 9.1.9
dev: false
/@intlify/core-base/9.2.0-beta.34: /@intlify/core-base/9.2.0-beta.34:
resolution: {integrity: sha512-MwWvL7GMpFeYBfFOU2fDj8V+kodtoGv3ZjK0qxnQtJ6oWtmv2ldqRuIu1NxPSmykYYg4iljrG174EzZnQkIcqA==} resolution: {integrity: sha512-MwWvL7GMpFeYBfFOU2fDj8V+kodtoGv3ZjK0qxnQtJ6oWtmv2ldqRuIu1NxPSmykYYg4iljrG174EzZnQkIcqA==}
engines: {node: '>= 12'} engines: {node: '>= 12'}
@ -2564,6 +2576,13 @@ packages:
'@intlify/vue-devtools': 9.2.0-beta.34 '@intlify/vue-devtools': 9.2.0-beta.34
dev: false dev: false
/@intlify/devtools-if/9.1.9:
resolution: {integrity: sha512-oKSMKjttG3Ut/1UGEZjSdghuP3fwA15zpDPcjkf/1FjlOIm6uIBGMNS5jXzsZy593u+P/YcnrZD6cD3IVFz9vQ==}
engines: {node: '>= 10'}
dependencies:
'@intlify/shared': 9.1.9
dev: false
/@intlify/devtools-if/9.2.0-beta.34: /@intlify/devtools-if/9.2.0-beta.34:
resolution: {integrity: sha512-Q/MNzslMLKpVygLJDE2poOwzQFed3KTpAn6hPsN10pgBPNHwJGVi6LgBYsO/6TVszN0w4GA1cv+6nT3iIyW7+A==} resolution: {integrity: sha512-Q/MNzslMLKpVygLJDE2poOwzQFed3KTpAn6hPsN10pgBPNHwJGVi6LgBYsO/6TVszN0w4GA1cv+6nT3iIyW7+A==}
engines: {node: '>= 12'} engines: {node: '>= 12'}
@ -2571,6 +2590,15 @@ packages:
'@intlify/shared': 9.2.0-beta.34 '@intlify/shared': 9.2.0-beta.34
dev: false dev: false
/@intlify/message-compiler/9.1.9:
resolution: {integrity: sha512-6YgCMF46Xd0IH2hMRLCssZI3gFG4aywidoWQ3QP4RGYQXQYYfFC54DxhSgfIPpVoPLQ+4AD29eoYmhiHZ+qLFQ==}
engines: {node: '>= 10'}
dependencies:
'@intlify/message-resolver': 9.1.9
'@intlify/shared': 9.1.9
source-map: 0.6.1
dev: false
/@intlify/message-compiler/9.2.0-beta.34: /@intlify/message-compiler/9.2.0-beta.34:
resolution: {integrity: sha512-l7JjkXJBW2l6cFZqPvI6oWU6QZn/i70agU6QB02W1O+6quFCFNpsiPswgYyQrmfHt4F4qYhLJUMZltIW/cqcbw==} resolution: {integrity: sha512-l7JjkXJBW2l6cFZqPvI6oWU6QZn/i70agU6QB02W1O+6quFCFNpsiPswgYyQrmfHt4F4qYhLJUMZltIW/cqcbw==}
engines: {node: '>= 12'} engines: {node: '>= 12'}
@ -2579,11 +2607,39 @@ packages:
source-map: 0.6.1 source-map: 0.6.1
dev: false dev: false
/@intlify/message-resolver/9.1.9:
resolution: {integrity: sha512-Lx/DBpigeK0sz2BBbzv5mu9/dAlt98HxwbG7xLawC3O2xMF9MNWU5FtOziwYG6TDIjNq0O/3ZbOJAxwITIWXEA==}
engines: {node: '>= 10'}
dev: false
/@intlify/runtime/9.1.9:
resolution: {integrity: sha512-XgPw8+UlHCiie3fI41HPVa/VDJb3/aSH7bLhY1hJvlvNV713PFtb4p4Jo+rlE0gAoMsMCGcsiT982fImolSltg==}
engines: {node: '>= 10'}
dependencies:
'@intlify/message-compiler': 9.1.9
'@intlify/message-resolver': 9.1.9
'@intlify/shared': 9.1.9
dev: false
/@intlify/shared/9.1.9:
resolution: {integrity: sha512-xKGM1d0EAxdDFCWedcYXOm6V5Pfw/TMudd6/qCdEb4tv0hk9EKeg7lwQF1azE0dP2phvx0yXxrt7UQK+IZjNdw==}
engines: {node: '>= 10'}
dev: false
/@intlify/shared/9.2.0-beta.34: /@intlify/shared/9.2.0-beta.34:
resolution: {integrity: sha512-hbUKcVbTOkLVpnlSeZE1OPgEI7FpvhuZF/gb84xECTjXEImIa3u0fIcJKUUffv3dlAx8fMOE5xKgDzngidm0tw==} resolution: {integrity: sha512-hbUKcVbTOkLVpnlSeZE1OPgEI7FpvhuZF/gb84xECTjXEImIa3u0fIcJKUUffv3dlAx8fMOE5xKgDzngidm0tw==}
engines: {node: '>= 12'} engines: {node: '>= 12'}
dev: false dev: false
/@intlify/vue-devtools/9.1.9:
resolution: {integrity: sha512-YPehH9uL4vZcGXky4Ev5qQIITnHKIvsD2GKGXgqf+05osMUI6WSEQHaN9USRa318Rs8RyyPCiDfmA0hRu3k7og==}
engines: {node: '>= 10'}
dependencies:
'@intlify/message-resolver': 9.1.9
'@intlify/runtime': 9.1.9
'@intlify/shared': 9.1.9
dev: false
/@intlify/vue-devtools/9.2.0-beta.34: /@intlify/vue-devtools/9.2.0-beta.34:
resolution: {integrity: sha512-0fEUqxZ2XibWNpWr1OTQrz0hBgqiWdXOvg5D6NjYBYIrSlJ13cPFfkfPBlnKUkrfBdw7RG6l+SlcUwIPj0ViGA==} resolution: {integrity: sha512-0fEUqxZ2XibWNpWr1OTQrz0hBgqiWdXOvg5D6NjYBYIrSlJ13cPFfkfPBlnKUkrfBdw7RG6l+SlcUwIPj0ViGA==}
engines: {node: '>= 12'} engines: {node: '>= 12'}
@ -2991,10 +3047,31 @@ packages:
vue-demi: 0.12.5_vue@3.2.33 vue-demi: 0.12.5_vue@3.2.33
dev: false dev: false
/@vueuse/core/8.3.1_vue@3.2.33:
resolution: {integrity: sha512-WiXUgVyPG9elGx3G8UV8g+zqbEJ2hYacrPICogAxDdW6hnxxcUFdF7FtvDroJ/DxWmo2pg8XNNz07ybfnZyJbw==}
peerDependencies:
'@vue/composition-api': ^1.1.0
vue: ^2.6.0 || ^3.2.0
peerDependenciesMeta:
'@vue/composition-api':
optional: true
vue:
optional: true
dependencies:
'@vueuse/metadata': 8.3.1
'@vueuse/shared': 8.3.1_vue@3.2.33
vue: 3.2.33
vue-demi: 0.12.5_vue@3.2.33
dev: false
/@vueuse/metadata/8.3.0: /@vueuse/metadata/8.3.0:
resolution: {integrity: sha512-7R/LNPQWp1r/owa2e71l3dFlJ21p89YE3ks14ZclP2VOTvhC6AzDRcpk+ChISNetv8spsFbWZj/Z7sFjbFZfuw==} resolution: {integrity: sha512-7R/LNPQWp1r/owa2e71l3dFlJ21p89YE3ks14ZclP2VOTvhC6AzDRcpk+ChISNetv8spsFbWZj/Z7sFjbFZfuw==}
dev: false dev: false
/@vueuse/metadata/8.3.1:
resolution: {integrity: sha512-1aZaFL44HzXXkfN6Q7KMDOXBFKTHDClHlOJBxtN8rTBXIIScoGOrJCpxWiQ4kuVg95MzG/pHrd3P4wd8poL9XQ==}
dev: false
/@vueuse/shared/8.3.0_vue@3.2.33: /@vueuse/shared/8.3.0_vue@3.2.33:
resolution: {integrity: sha512-xehtLfevPw9nsVIGFe/tWMtFvbvZjeAfXh7DT9Fptt/6/C5rLwpJtxsVguIBtPybjwobO4KCpQYS78aa9fg5Sw==} resolution: {integrity: sha512-xehtLfevPw9nsVIGFe/tWMtFvbvZjeAfXh7DT9Fptt/6/C5rLwpJtxsVguIBtPybjwobO4KCpQYS78aa9fg5Sw==}
peerDependencies: peerDependencies:
@ -3010,6 +3087,21 @@ packages:
vue-demi: 0.12.5_vue@3.2.33 vue-demi: 0.12.5_vue@3.2.33
dev: false dev: false
/@vueuse/shared/8.3.1_vue@3.2.33:
resolution: {integrity: sha512-7HKLCcxp4dtONq6QSSoavblo9riYgqzw7jhqiC0/VUYMXKzqj1G/GznOzTmY8Wi8uKKT197JqjKQ1DKt2j/0+A==}
peerDependencies:
'@vue/composition-api': ^1.1.0
vue: ^2.6.0 || ^3.2.0
peerDependenciesMeta:
'@vue/composition-api':
optional: true
vue:
optional: true
dependencies:
vue: 3.2.33
vue-demi: 0.12.5_vue@3.2.33
dev: false
/JSONStream/1.3.5: /JSONStream/1.3.5:
resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==}
hasBin: true hasBin: true
@ -5838,6 +5930,19 @@ packages:
- supports-color - supports-color
dev: true dev: true
/vue-i18n/9.1.9_vue@3.2.33:
resolution: {integrity: sha512-JeRdNVxS2OGp1E+pye5XB6+M6BBkHwAv9C80Q7+kzoMdUDGRna06tjC0vCB/jDX9aWrl5swxOMFcyAr7or8XTA==}
engines: {node: '>= 10'}
peerDependencies:
vue: ^3.0.0
dependencies:
'@intlify/core-base': 9.1.9
'@intlify/shared': 9.1.9
'@intlify/vue-devtools': 9.1.9
'@vue/devtools-api': 6.1.4
vue: 3.2.33
dev: false
/vue-i18n/9.2.0-beta.34_vue@3.2.33: /vue-i18n/9.2.0-beta.34_vue@3.2.33:
resolution: {integrity: sha512-AKzOMn91OKBKHTPVWrDF+kBSbYYNGfBeeBhuihkxW2ZTXd1l8vp7WBqA6weV9kb9EDv7HO61Qhctqcr79TmHVw==} resolution: {integrity: sha512-AKzOMn91OKBKHTPVWrDF+kBSbYYNGfBeeBhuihkxW2ZTXd1l8vp7WBqA6weV9kb9EDv7HO61Qhctqcr79TmHVw==}
engines: {node: '>= 12'} engines: {node: '>= 12'}