📝(all): 更新日志

This commit is contained in:
就眠儀式 2022-06-27 18:43:01 +08:00
parent 0a3ac48d95
commit d92880da97
10 changed files with 93 additions and 80 deletions

View File

@ -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",

View File

@ -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();

View File

@ -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>
<!-- 日期选择 --> <!-- 日期选择 -->

View File

@ -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;
} }

View File

@ -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>

View File

@ -56,7 +56,7 @@ const router = useRouter();
watch(active, (val) => { watch(active, (val) => {
router.push(val); router.push(val);
}) });
</script> </script>
<style> <style>

View File

@ -166,7 +166,10 @@ const firstOpenDelayCalculation = function () {
} }
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];