| | |
| | | `${prefix}-class-suffix-icon`, |
| | | ]; |
| | | this.options = { |
| | | styleIsolation: 'apply-shared', |
| | | multipleSlots: true, |
| | | pureDataPattern: /^__/, |
| | | }; |
| | | this.properties = props; |
| | | this.data = { |
| | | prefix, |
| | | classPrefix: name, |
| | | loop: -1, |
| | | __ready: false, |
| | | }; |
| | | this.observers = { |
| | | marquee(val) { |
| | |
| | | } |
| | | }, |
| | | visible(visible) { |
| | | if (!this.data.__ready) |
| | | return; |
| | | if (visible) { |
| | | this.show(); |
| | | } |
| | |
| | | }); |
| | | }, |
| | | content() { |
| | | if (!this.data.__ready) |
| | | return; |
| | | this.clearNoticeBarAnimation(); |
| | | this.initAnimation(); |
| | | }, |
| | |
| | | }, |
| | | ready() { |
| | | this.show(); |
| | | this.setData({ __ready: true }); |
| | | }, |
| | | }; |
| | | this.methods = { |
| | |
| | | const warpID = `.${name}__content-wrap`; |
| | | const nodeID = `.${name}__content`; |
| | | getAnimationFrame(this, () => { |
| | | Promise.all([getRect(this, nodeID), getRect(this, warpID)]).then(([nodeRect, wrapRect]) => { |
| | | Promise.all([getRect(this, nodeID), getRect(this, warpID)]) |
| | | .then(([nodeRect, wrapRect]) => { |
| | | const { marquee } = this.properties; |
| | | if (nodeRect == null || wrapRect == null || !nodeRect.width || !wrapRect.width) { |
| | | return; |
| | |
| | | }); |
| | | marquee.loop !== 0 && this.startScrollAnimation(true); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => { }); |
| | | }); |
| | | }, |
| | | startScrollAnimation(isFirstScroll = false) { |
| | |
| | | _prefixIcon: calcIcon(v, THEME_ICON[theme]), |
| | | }); |
| | | }, |
| | | onChange(e) { |
| | | const { current, source } = e.detail; |
| | | this.triggerEvent('change', { current, source }); |
| | | }, |
| | | clickPrefixIcon() { |
| | | this.triggerEvent('click', { trigger: 'prefix-icon' }); |
| | | }, |