📝(all): 更新日志
This commit is contained in:
parent
0a3ac48d95
commit
d92880da97
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@layui/layui-vue",
|
"name": "@layui/layui-vue",
|
||||||
"version": "1.2.3",
|
"version": "1.2.4-alpha.1",
|
||||||
"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",
|
||||||
|
@ -18,12 +18,12 @@ export interface LayAiffxProps {
|
|||||||
}
|
}
|
||||||
const props = withDefaults(defineProps<LayAiffxProps>(), {
|
const props = withDefaults(defineProps<LayAiffxProps>(), {
|
||||||
offset: 0,
|
offset: 0,
|
||||||
position: 'top',
|
position: "top",
|
||||||
target: () => {
|
target: () => {
|
||||||
return document.body;
|
return document.body;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['scroll'])
|
const emit = defineEmits(["scroll"]);
|
||||||
const outWindow = ref(false);
|
const outWindow = ref(false);
|
||||||
const dom = ref();
|
const dom = ref();
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ const getStyle = computed(() => {
|
|||||||
bottom: "unset",
|
bottom: "unset",
|
||||||
left: orginOffsetLeft - marginLeft + "px",
|
left: orginOffsetLeft - marginLeft + "px",
|
||||||
};
|
};
|
||||||
if (props.position === 'top') {
|
if (props.position === "top") {
|
||||||
style.top = fixedOffset - marginTop + "px";
|
style.top = fixedOffset - marginTop + "px";
|
||||||
} else {
|
} else {
|
||||||
style.bottom = fixedOffset - marginBottom + "px";
|
style.bottom = fixedOffset - marginBottom + "px";
|
||||||
@ -56,7 +56,7 @@ const checkInWindow = () => {
|
|||||||
if (dom.value) {
|
if (dom.value) {
|
||||||
let offsetTop = dom.value.offsetTop;
|
let offsetTop = dom.value.offsetTop;
|
||||||
let scrollTop = props.target?.scrollTop;
|
let scrollTop = props.target?.scrollTop;
|
||||||
if (props.position === 'top') {
|
if (props.position === "top") {
|
||||||
//top检查 当前元素与容器顶部距离-减去滚动条的高度+容器offsetTop
|
//top检查 当前元素与容器顶部距离-减去滚动条的高度+容器offsetTop
|
||||||
let result = offsetTop - scrollTop + props.target.offsetTop;
|
let result = offsetTop - scrollTop + props.target.offsetTop;
|
||||||
if (result < fixedOffset) {
|
if (result < fixedOffset) {
|
||||||
@ -82,15 +82,15 @@ const checkInWindow = () => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (result < fixedOffset) {
|
if (result < fixedOffset) {
|
||||||
changeScrollTop = scrollTop - result + props.offset
|
changeScrollTop = scrollTop - result + props.offset;
|
||||||
outWindow.value = true;
|
outWindow.value = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emit('scroll', {
|
emit("scroll", {
|
||||||
targetScroll: scrollTop,
|
targetScroll: scrollTop,
|
||||||
affixed: outWindow.value,
|
affixed: outWindow.value,
|
||||||
offset: !outWindow.value ? 0 : Math.abs(scrollTop - changeScrollTop)
|
offset: !outWindow.value ? 0 : Math.abs(scrollTop - changeScrollTop),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -106,14 +106,14 @@ const getDomStyle = (dom: any, attr: string) => {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
orginOffsetTop = dom.value.offsetTop - props.target.offsetTop
|
orginOffsetTop = dom.value.offsetTop - props.target.offsetTop;
|
||||||
orginOffsetLeft = dom.value.getBoundingClientRect().left
|
orginOffsetLeft = dom.value.getBoundingClientRect().left;
|
||||||
marginLeft = parseFloat(getDomStyle(dom.value, 'marginLeft'))
|
marginLeft = parseFloat(getDomStyle(dom.value, "marginLeft"));
|
||||||
marginTop = parseFloat(getDomStyle(dom.value, 'marginTop'))
|
marginTop = parseFloat(getDomStyle(dom.value, "marginTop"));
|
||||||
marginBottom = parseFloat(getDomStyle(dom.value, 'marginBottom'))
|
marginBottom = parseFloat(getDomStyle(dom.value, "marginBottom"));
|
||||||
fixedOffset = props.offset + props.target.offsetTop
|
fixedOffset = props.offset + props.target.offsetTop;
|
||||||
if (props.position === 'bottom') {
|
if (props.position === "bottom") {
|
||||||
fixedOffset = props.offset
|
fixedOffset = props.offset;
|
||||||
}
|
}
|
||||||
props.target.addEventListener("scroll", checkInWindow, true);
|
props.target.addEventListener("scroll", checkInWindow, true);
|
||||||
checkInWindow();
|
checkInWindow();
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<lay-dropdown ref="dropdownRef" :disabled="props.disabled">
|
<lay-dropdown ref="dropdownRef" :disabled="props.disabled">
|
||||||
<lay-input :name="name" :value="dateValue || modelValue" readonly>
|
<lay-input
|
||||||
<template #prefix>
|
readonly
|
||||||
<lay-icon type="layui-icon-date"></lay-icon>
|
:name="name"
|
||||||
</template>
|
:value="dateValue || modelValue"
|
||||||
|
prefix-icon="layui-icon-date">
|
||||||
</lay-input>
|
</lay-input>
|
||||||
<template #content>
|
<template #content>
|
||||||
<!-- 日期选择 -->
|
<!-- 日期选择 -->
|
||||||
|
@ -25,8 +25,9 @@
|
|||||||
border-radius: var(--input-border-radius);
|
border-radius: var(--input-border-radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.layui-input-wrapper:hover,
|
||||||
.layui-input-wrapper:focus-within {
|
.layui-input-wrapper:focus-within {
|
||||||
border-color: var(--global-checked-color);
|
border-color: #d2d2d2 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-input-prefix {
|
.layui-input-prefix {
|
||||||
@ -55,14 +56,6 @@
|
|||||||
color: rgba(0, 0, 0, 0.45);
|
color: rgba(0, 0, 0, 0.45);
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-input:hover {
|
|
||||||
border-color: #eee !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.layui-input:focus {
|
|
||||||
border-color: #d2d2d2 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.layui-input::-webkit-input-placeholder {
|
.layui-input::-webkit-input-placeholder {
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<lay-timeline>
|
<lay-timeline>
|
||||||
<lay-timeline-item title="1.2.x">
|
<lay-timeline-item title="1.2.x">
|
||||||
|
<ul>
|
||||||
|
<a name="1-2-4"></a>
|
||||||
|
<li>
|
||||||
|
<h3>1.2.4 <span class="layui-badge-rim">2022-06-27</span></h3>
|
||||||
|
<ul>
|
||||||
|
<li>[新增] table 组件 even 属性, 用于开启斑马条纹背景样式。</li>
|
||||||
|
<li>[新增] dropdown 组件 placement 属性 right left right-bottom right-top left-bottom left-top 值。</li>
|
||||||
|
<li>[新增] affix 组件, 使用锚点,可以将内容固定在容器内,并且不随容器的滚动而滚动,常用于侧边菜单导航等。 </li>
|
||||||
|
<li>[新增] affix 组件 position 属性, 用于设置固定的位置, 可选值为 top 与 bottom。</li>
|
||||||
|
<li>[新增] affix 组件 offset 属性, 定位偏移量, 默认为 0。</li>
|
||||||
|
<li>[新增] affix 组件 target 属性, 定位时的参考容器, 默认为 document.body。</li>
|
||||||
|
<li>[修复] date-picker 组件 prefix-icon 前置图标无边距的问题。</li>
|
||||||
|
<li>[修复] input 组件 foucs 状态时 border 颜色为 #d2d2d2。</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<a name="1-2-3"></a>
|
<a name="1-2-3"></a>
|
||||||
<li>
|
<li>
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="lay-code">
|
<div class="lay-code">
|
||||||
<div id="source" class="source">
|
<div id="source" class="source">
|
||||||
<slot ></slot>
|
<slot></slot>
|
||||||
<div v-if="$slots.description" class="description">
|
<div v-if="$slots.description" class="description">
|
||||||
<slot name="description" ></slot>
|
<slot name="description"></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div ref="meta" class="meta">
|
<div ref="meta" class="meta">
|
||||||
<div class="language-html">
|
<div class="language-html">
|
||||||
<slot name="code" ></slot>
|
<slot name="code"></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div :class="{ 'is-fixed': isFixContorl }" class="control">
|
<div :class="{ 'is-fixed': isFixContorl }" class="control">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<lay-scroll height="100%">
|
<lay-scroll height="100%">
|
||||||
<div class="markdown-body light-scheme">
|
<div class="markdown-body light-scheme">
|
||||||
<div class="alone-header">
|
<div class="alone-header">
|
||||||
<img class="alone-logo" src="../assets/logo.png" />
|
<img class="alone-logo" src="../assets/logo.png" />
|
||||||
@ -41,7 +41,7 @@
|
|||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</lay-scroll>
|
</lay-scroll>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -56,7 +56,7 @@ const router = useRouter();
|
|||||||
|
|
||||||
watch(active, (val) => {
|
watch(active, (val) => {
|
||||||
router.push(val);
|
router.push(val);
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@ -133,6 +133,6 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.layui-tab-content {
|
.layui-tab-content {
|
||||||
padding: 0!important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -159,14 +159,17 @@ const _l: Ref<string> = ref(offset.value[1]);
|
|||||||
* <p>
|
* <p>
|
||||||
*/
|
*/
|
||||||
const firstOpenDelayCalculation = function () {
|
const firstOpenDelayCalculation = function () {
|
||||||
nextTick( async () => {
|
nextTick(async () => {
|
||||||
area.value = getArea(layero.value);
|
area.value = getArea(layero.value);
|
||||||
if (type == 4) {
|
if (type == 4) {
|
||||||
area.value = calculateDrawerArea(props.offset, props.area);
|
area.value = calculateDrawerArea(props.offset, props.area);
|
||||||
}
|
}
|
||||||
if (type == 5) {
|
if (type == 5) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
area.value = await calculatePhotosArea(props.imgList[props.startIndex].src, props);
|
area.value = await calculatePhotosArea(
|
||||||
|
props.imgList[props.startIndex].src,
|
||||||
|
props
|
||||||
|
);
|
||||||
}
|
}
|
||||||
offset.value = calculateOffset(props.offset, area.value, props.type);
|
offset.value = calculateOffset(props.offset, area.value, props.type);
|
||||||
w.value = area.value[0];
|
w.value = area.value[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user