From 06e35dc04465167be796138935a42d4a4e8655cb Mon Sep 17 00:00:00 2001 From: satori Date: Mon, 9 Dec 2024 16:54:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D=E7=82=B9?= =?UTF-8?q?=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 6 +++++- package.json | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 1e1e3a9..8d0309b 100644 --- a/main.js +++ b/main.js @@ -77,9 +77,13 @@ document.body.appendChild( div.text(item.content).h("4rem"), ], onclick: function (event) { + if (this.dataset.lock) return + this.dataset.lock = true + const height = `${this.scrollHeight}px` const { marginTop, marginBottom, paddingTop, paddingBottom } = this.style + console.log(marginTop, marginBottom, paddingTop, paddingBottom, height) const animation = [ - { transform: "scaleY(1)", opacity: 1, height: this.scrollHeight + 'px', marginTop, marginBottom, paddingTop, paddingBottom }, + { transform: "scaleY(1)", opacity: 1, height, marginTop, marginBottom, paddingTop, paddingBottom }, { transform: "scaleY(0)", opacity: 0, height: 0, marginTop: 0, marginBottom: 0, paddingTop: 0, paddingBottom: 0 }, ] this.animate(animation, { duration: 750, easing: "ease", fill: "forwards" }).onfinish = () => { diff --git a/package.json b/package.json index dd0206e..566b935 100755 --- a/package.json +++ b/package.json @@ -4,9 +4,10 @@ "private": true, "scripts": { "dev": "vite", - "serve": "vue-cli-service serve", - "build": "vue-cli-service build", - "lint": "vue-cli-service lint" + "build": "vite build", + "vueserve": "vue-cli-service serve", + "vuebuild": "vue-cli-service build", + "vuelint": "vue-cli-service lint" }, "dependencies": { "@laniakeasupercluster/widgets": "^1.1.8",