@mptw/skylens-ui 1.5.20 → 1.5.21

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.
package/app/app.vue CHANGED
@@ -1,6 +1,7 @@
1
1
  <template lang="pug">
2
2
  div
3
3
  SLCollapsableBlock(blockTitle='三方比對組')
4
+ .p-2 abc
4
5
  </template>
5
6
 
6
7
  <script setup lang="ts"></script>
@@ -47,6 +47,8 @@ export default defineComponent({
47
47
  const isCollapsed = ref(defaultCollapsed.value);
48
48
  const bodyHeight = ref(0);
49
49
 
50
+ let observer: MutationObserver | null = null;
51
+
50
52
  function onToggleCollapse() {
51
53
  isCollapsed.value = !isCollapsed.value;
52
54
  }
@@ -84,6 +86,21 @@ export default defineComponent({
84
86
  onMounted(() => {
85
87
  getWrapperHeight();
86
88
  checkImageLoaded();
89
+
90
+ if (wrapperEl.value) {
91
+ observer = new MutationObserver(getWrapperHeight);
92
+ observer.observe(wrapperEl.value, {
93
+ childList: true,
94
+ attributes: true,
95
+ subtree: true,
96
+ });
97
+ }
98
+ });
99
+
100
+ onBeforeUnmount(() => {
101
+ if (observer) {
102
+ observer.disconnect();
103
+ }
87
104
  });
88
105
 
89
106
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mptw/skylens-ui",
3
3
  "type": "module",
4
- "version": "1.5.20",
4
+ "version": "1.5.21",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground",