升级 layer-vue 1.2.3

This commit is contained in:
就眠儀式 2022-01-02 20:50:24 +08:00
parent e22c521980
commit 9f0bec1339
2 changed files with 5 additions and 4 deletions

View File

@ -108,6 +108,7 @@ const handlerScroll = () => {
const handlerCollapse = () => {
iconType.value = show.value ? "layui-icon-right" : "layui-icon-left";
// @ts-ignore
scrollRefEl.value!.firstElementChild!.style.marginRight = show.value
? "180px"
: "0px";
@ -118,7 +119,7 @@ watch(show, () => {
});
onMounted(() => {
// TODO hooks
// @ts-ignore TODO hooks
scrollRefEl.value = document.querySelector(".layui-body");
if (!scrollRefEl.value) {
throw new Error(`scroll element is not existed: ".layui-body"`);
@ -126,8 +127,8 @@ onMounted(() => {
scrollRefEl.value.scrollTop = 0;
scrollRefEl.value?.addEventListener("scroll", throttle(handlerScroll, 500));
// ,,
show.value =
scrollRefEl.value!.firstElementChild!.style.marginRight !== "0px";
// @ts-ignore
show.value = scrollRefEl.value!.firstElementChild!.style.marginRight !== "0px";
enableAnimation = show.value;
});

View File

@ -34,7 +34,7 @@
"dependencies": {
"@layui/hooks-vue": "^0.1.6",
"@layui/icons-vue": "^1.0.2",
"@layui/layer-vue": "^1.2.2",
"@layui/layer-vue": "^1.2.3",
"async-validator": "^4.0.7",
"countup.js": "^2.0.8",
"evtd": "^0.2.3",