parent
d7918768b9
commit
724b3732a0
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@bd/core",
|
"name": "@bd/core",
|
||||||
"version": "1.8.1",
|
"version": "1.8.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "百搭UI组件库的核心",
|
"description": "百搭UI组件库的核心",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|
|
@ -630,11 +630,8 @@ class AnimPart extends AttributePart {
|
||||||
if (custom) {
|
if (custom) {
|
||||||
fromto = custom
|
fromto = custom
|
||||||
}
|
}
|
||||||
this.element.$anim = {
|
this.element.$animate = function (out = false) {
|
||||||
el: this.element,
|
animate.call(this, duration, fromto, out)
|
||||||
start(out = false) {
|
|
||||||
animate.call(this.el, duration, fromto, out)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
src/index.js
10
src/index.js
|
@ -88,15 +88,11 @@ export class Component extends HTMLElement {
|
||||||
static parseAnim() {
|
static parseAnim() {
|
||||||
if (this.hasOwnProperty('animation')) {
|
if (this.hasOwnProperty('animation')) {
|
||||||
let { type = 'fade', duration } = this.animation
|
let { type = 'fade', duration } = this.animation
|
||||||
Object.defineProperty(this.prototype, '$anim', {
|
Object.defineProperty(this.prototype, '$animate', {
|
||||||
get() {
|
value(out) {
|
||||||
return {
|
|
||||||
start: out => {
|
|
||||||
if (this[__mounted__]) {
|
if (this[__mounted__]) {
|
||||||
animate.call(this, duration, MODES[type], out)
|
animate.call(this, duration, MODES[type], out)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
enumerable: false
|
enumerable: false
|
||||||
})
|
})
|
||||||
|
@ -175,7 +171,7 @@ export class Component extends HTMLElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
if (this.$anim) {
|
if (this.$animate) {
|
||||||
this.style.display = 'none'
|
this.style.display = 'none'
|
||||||
}
|
}
|
||||||
this.#init()
|
this.#init()
|
||||||
|
|
Loading…
Reference in New Issue