📝(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",
"version": "1.2.3",
"version": "1.2.4-alpha.1",
"author": "就眠儀式",
"license": "MIT",
"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>(), {
offset: 0,
position: 'top',
position: "top",
target: () => {
return document.body;
},
});
const emit = defineEmits(['scroll'])
const emit = defineEmits(["scroll"]);
const outWindow = ref(false);
const dom = ref();
@ -43,7 +43,7 @@ const getStyle = computed(() => {
bottom: "unset",
left: orginOffsetLeft - marginLeft + "px",
};
if (props.position === 'top') {
if (props.position === "top") {
style.top = fixedOffset - marginTop + "px";
} else {
style.bottom = fixedOffset - marginBottom + "px";
@ -56,7 +56,7 @@ const checkInWindow = () => {
if (dom.value) {
let offsetTop = dom.value.offsetTop;
let scrollTop = props.target?.scrollTop;
if (props.position === 'top') {
if (props.position === "top") {
//top -+offsetTop
let result = offsetTop - scrollTop + props.target.offsetTop;
if (result < fixedOffset) {
@ -82,15 +82,15 @@ const checkInWindow = () => {
}
} else {
if (result < fixedOffset) {
changeScrollTop = scrollTop - result + props.offset
changeScrollTop = scrollTop - result + props.offset;
outWindow.value = true;
}
}
}
emit('scroll', {
emit("scroll", {
targetScroll: scrollTop,
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(() => {
nextTick(() => {
orginOffsetTop = dom.value.offsetTop - props.target.offsetTop
orginOffsetLeft = dom.value.getBoundingClientRect().left
marginLeft = parseFloat(getDomStyle(dom.value, 'marginLeft'))
marginTop = parseFloat(getDomStyle(dom.value, 'marginTop'))
marginBottom = parseFloat(getDomStyle(dom.value, 'marginBottom'))
fixedOffset = props.offset + props.target.offsetTop
if (props.position === 'bottom') {
fixedOffset = props.offset
orginOffsetTop = dom.value.offsetTop - props.target.offsetTop;
orginOffsetLeft = dom.value.getBoundingClientRect().left;
marginLeft = parseFloat(getDomStyle(dom.value, "marginLeft"));
marginTop = parseFloat(getDomStyle(dom.value, "marginTop"));
marginBottom = parseFloat(getDomStyle(dom.value, "marginBottom"));
fixedOffset = props.offset + props.target.offsetTop;
if (props.position === "bottom") {
fixedOffset = props.offset;
}
props.target.addEventListener("scroll", checkInWindow, true);
checkInWindow();

View File

@ -1,10 +1,11 @@
<template>
<div>
<lay-dropdown ref="dropdownRef" :disabled="props.disabled">
<lay-input :name="name" :value="dateValue || modelValue" readonly>
<template #prefix>
<lay-icon type="layui-icon-date"></lay-icon>
</template>
<lay-input
readonly
:name="name"
:value="dateValue || modelValue"
prefix-icon="layui-icon-date">
</lay-input>
<template #content>
<!-- 日期选择 -->

View File

@ -25,8 +25,9 @@
border-radius: var(--input-border-radius);
}
.layui-input-wrapper:hover,
.layui-input-wrapper:focus-within {
border-color: var(--global-checked-color);
border-color: #d2d2d2 !important;
}
.layui-input-prefix {
@ -55,14 +56,6 @@
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 {
line-height: 1.3;
}

View File

@ -11,7 +11,23 @@
<template>
<lay-timeline>
<lay-timeline-item title="1.2.x">
<ul>
<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>
<a name="1-2-3"></a>
<li>
<h3>1.2.3 <span class="layui-badge-rim">2022-06-26</span></h3>

View File

@ -1,14 +1,14 @@
<template>
<div class="lay-code">
<div id="source" class="source">
<slot ></slot>
<slot></slot>
<div v-if="$slots.description" class="description">
<slot name="description" ></slot>
<slot name="description"></slot>
</div>
</div>
<div ref="meta" class="meta">
<div class="language-html">
<slot name="code" ></slot>
<slot name="code"></slot>
</div>
</div>
<div :class="{ 'is-fixed': isFixContorl }" class="control">

View File

@ -1,47 +1,47 @@
<template>
<lay-scroll height="100%">
<div class="markdown-body light-scheme">
<div class="alone-header">
<img class="alone-logo" src="../assets/logo.png" />
<a
style="
position: absolute;
right: 16%;
line-height: 60px;
color: white;
font-size: 15px;
"
>{{ version }}</a
>
<a
href="https://gitee.com/layui-vue/layer-vue"
style="position: absolute; right: 10%; line-height: 75px"
>
<svg width="1.7em" height="1.7em" viewBox="0 0 24 24">
<path
fill="#fff"
d="M10.9,2.1c-4.6,0.5-8.3,4.2-8.8,8.7c-0.5,4.7,2.2,8.9,6.3,10.5C8.7,21.4,9,21.2,9,20.8v-1.6c0,0-0.4,0.1-0.9,0.1 c-1.4,0-2-1.2-2.1-1.9c-0.1-0.4-0.3-0.7-0.6-1C5.1,16.3,5,16.3,5,16.2C5,16,5.3,16,5.4,16c0.6,0,1.1,0.7,1.3,1c0.5,0.8,1.1,1,1.4,1 c0.4,0,0.7-0.1,0.9-0.2c0.1-0.7,0.4-1.4,1-1.8c-2.3-0.5-4-1.8-4-4c0-1.1,0.5-2.2,1.2-3C7.1,8.8,7,8.3,7,7.6C7,7.2,7,6.6,7.3,6 c0,0,1.4,0,2.8,1.3C10.6,7.1,11.3,7,12,7s1.4,0.1,2,0.3C15.3,6,16.8,6,16.8,6C17,6.6,17,7.2,17,7.6c0,0.8-0.1,1.2-0.2,1.4 c0.7,0.8,1.2,1.8,1.2,3c0,2.2-1.7,3.5-4,4c0.6,0.5,1,1.4,1,2.3v2.6c0,0.3,0.3,0.6,0.7,0.5c3.7-1.5,6.3-5.1,6.3-9.3 C22,6.1,16.9,1.4,10.9,2.1z"
></path>
</svg>
</a>
</div>
<div class="alone-banner layui-bg-black">
<div class="layui-main">
<img src="../assets/logo.jpg" />
<h1>layer vue</h1>
<p> </p>
<lay-scroll height="100%">
<div class="markdown-body light-scheme">
<div class="alone-header">
<img class="alone-logo" src="../assets/logo.png" />
<a
style="
position: absolute;
right: 16%;
line-height: 60px;
color: white;
font-size: 15px;
"
>{{ version }}</a
>
<a
href="https://gitee.com/layui-vue/layer-vue"
style="position: absolute; right: 10%; line-height: 75px"
>
<svg width="1.7em" height="1.7em" viewBox="0 0 24 24">
<path
fill="#fff"
d="M10.9,2.1c-4.6,0.5-8.3,4.2-8.8,8.7c-0.5,4.7,2.2,8.9,6.3,10.5C8.7,21.4,9,21.2,9,20.8v-1.6c0,0-0.4,0.1-0.9,0.1 c-1.4,0-2-1.2-2.1-1.9c-0.1-0.4-0.3-0.7-0.6-1C5.1,16.3,5,16.3,5,16.2C5,16,5.3,16,5.4,16c0.6,0,1.1,0.7,1.3,1c0.5,0.8,1.1,1,1.4,1 c0.4,0,0.7-0.1,0.9-0.2c0.1-0.7,0.4-1.4,1-1.8c-2.3-0.5-4-1.8-4-4c0-1.1,0.5-2.2,1.2-3C7.1,8.8,7,8.3,7,7.6C7,7.2,7,6.6,7.3,6 c0,0,1.4,0,2.8,1.3C10.6,7.1,11.3,7,12,7s1.4,0.1,2,0.3C15.3,6,16.8,6,16.8,6C17,6.6,17,7.2,17,7.6c0,0.8-0.1,1.2-0.2,1.4 c0.7,0.8,1.2,1.8,1.2,3c0,2.2-1.7,3.5-4,4c0.6,0.5,1,1.4,1,2.3v2.6c0,0.3,0.3,0.6,0.7,0.5c3.7-1.5,6.3-5.1,6.3-9.3 C22,6.1,16.9,1.4,10.9,2.1z"
></path>
</svg>
</a>
</div>
<div class="alone-banner layui-bg-black">
<div class="layui-main">
<img src="../assets/logo.jpg" />
<h1>layer vue</h1>
<p> </p>
</div>
</div>
<div class="layui-container" style="width: 80%; margin-left: 10%">
<lay-tab type="brief" v-model="active">
<lay-tab-item title="入门" id="/zh-CN/index"></lay-tab-item>
<lay-tab-item title="示例" id="/zh-CN/demo"></lay-tab-item>
<lay-tab-item title="帮助" id="/zh-CN/help"></lay-tab-item>
</lay-tab>
<router-view></router-view>
</div>
</div>
<div class="layui-container" style="width: 80%; margin-left: 10%">
<lay-tab type="brief" v-model="active">
<lay-tab-item title="入门" id="/zh-CN/index"></lay-tab-item>
<lay-tab-item title="示例" id="/zh-CN/demo"></lay-tab-item>
<lay-tab-item title="帮助" id="/zh-CN/help"></lay-tab-item>
</lay-tab>
<router-view></router-view>
</div>
</div>
</lay-scroll>
</lay-scroll>
</template>
<script setup>
@ -56,7 +56,7 @@ const router = useRouter();
watch(active, (val) => {
router.push(val);
})
});
</script>
<style>
@ -133,6 +133,6 @@ body {
}
.layui-tab-content {
padding: 0!important;
padding: 0 !important;
}
</style>

View File

@ -25,4 +25,4 @@ export function createApp(): {
.component("Children2", Children2);
return { app, router };
}
}

View File

@ -26,4 +26,4 @@ const zhCN = [
},
];
export default zhCN;
export default zhCN;

View File

@ -159,14 +159,17 @@ const _l: Ref<string> = ref(offset.value[1]);
* <p>
*/
const firstOpenDelayCalculation = function () {
nextTick( async () => {
nextTick(async () => {
area.value = getArea(layero.value);
if (type == 4) {
area.value = calculateDrawerArea(props.offset, props.area);
}
if (type == 5) {
// @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);
w.value = area.value[0];