防止重复点击
This commit is contained in:
parent
dd854c7bfb
commit
06e35dc044
6
main.js
6
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 = () => {
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user