@varlet/ui 2.22.1 → 2.22.2-alpha.1706882566427

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,10 +112,7 @@ const __sfc__ = defineComponent({
112
112
  () => length.value,
113
113
  () => __async(this, null, function* () {
114
114
  yield doubleRaf();
115
- indexAnchors.forEach(({ name: name2 }) => {
116
- if (name2.value)
117
- anchorNameList.value.push(name2.value);
118
- });
115
+ anchorNameList.value = indexAnchors.filter(({ name: name2 }) => name2.value != null).map(({ name: name2 }) => name2.value);
119
116
  })
120
117
  );
121
118
  onSmartMounted(() => __async(this, null, function* () {
@@ -262,7 +262,7 @@ import './tooltip/style/index.mjs'
262
262
  import './uploader/style/index.mjs'
263
263
  import './watermark/style/index.mjs'
264
264
 
265
- const version = '2.22.1'
265
+ const version = '2.22.2-alpha.1706882566427'
266
266
 
267
267
  function install(app) {
268
268
  ActionSheet.install && app.use(ActionSheet)
package/es/index.mjs CHANGED
@@ -174,7 +174,7 @@ export * from './tooltip/index.mjs'
174
174
  export * from './uploader/index.mjs'
175
175
  export * from './watermark/index.mjs'
176
176
 
177
- const version = '2.22.1'
177
+ const version = '2.22.2-alpha.1706882566427'
178
178
 
179
179
  function install(app) {
180
180
  ActionSheet.install && app.use(ActionSheet)
@@ -83,7 +83,10 @@ const __sfc__ = defineComponent({
83
83
  const offsetTop = computed(() => toPxNum(props2.offsetTop));
84
84
  let scroller;
85
85
  watch(() => props2.disabled, resize);
86
- onSmartMounted(addScrollListener);
86
+ onSmartMounted(() => __async(this, null, function* () {
87
+ yield doubleRaf();
88
+ handleScroll();
89
+ }));
87
90
  onSmartUnmounted(removeScrollListener);
88
91
  onWindowResize(resize);
89
92
  useEventListener(() => window, "scroll", handleScroll);
@@ -122,15 +125,27 @@ const __sfc__ = defineComponent({
122
125
  isFixed: false
123
126
  };
124
127
  }
128
+ function setupScroller() {
129
+ scroller = getParentScroller(stickyEl.value);
130
+ if (scroller !== window) {
131
+ scroller.addEventListener("scroll", handleScroll);
132
+ }
133
+ }
125
134
  function handleScroll() {
126
135
  if (!scroller) {
127
- return;
136
+ setupScroller();
128
137
  }
129
138
  const fixedParams = computeFixedParams();
130
139
  if (fixedParams) {
131
140
  call(props2.onScroll, fixedParams.offsetTop, fixedParams.isFixed);
132
141
  }
133
142
  }
143
+ function removeScrollListener() {
144
+ if (!scroller || scroller === window) {
145
+ return;
146
+ }
147
+ scroller.removeEventListener("scroll", handleScroll);
148
+ }
134
149
  function resize() {
135
150
  return __async(this, null, function* () {
136
151
  isFixed.value = false;
@@ -138,17 +153,6 @@ const __sfc__ = defineComponent({
138
153
  computeFixedParams();
139
154
  });
140
155
  }
141
- function addScrollListener() {
142
- return __async(this, null, function* () {
143
- yield doubleRaf();
144
- scroller = getParentScroller(stickyEl.value);
145
- scroller !== window && scroller.addEventListener("scroll", handleScroll);
146
- handleScroll();
147
- });
148
- }
149
- function removeScrollListener() {
150
- scroller !== window && scroller.removeEventListener("scroll", handleScroll);
151
- }
152
156
  return {
153
157
  stickyEl,
154
158
  wrapperEl,
File without changes