Skip to content

Commit ca5efa8

Browse files
committed
Fix: 手机端弹窗不显示修复
1 parent 5add3a3 commit ca5efa8

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

package/components/NanoContainer/index.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
v-model:fullscreen="ctl.fullscreen"
55
v-model:layout="containerLayout"
66
:drag-el="headerEl"
7-
:visible="visible"
8-
:width-range="[ '20vw', '100vw' ]"
7+
:visible="true"
8+
:width-range="[ '22vw', '100vw' ]"
99
:height-range="[ '60vh', '100vh' ]"
1010
class="nano-theme"
1111
>
@@ -42,7 +42,6 @@
4242
const header = ref<InstanceType<typeof NanoHeader> | null>();
4343
const resizeObserver = ref<ResizeObserver | null>(null);
4444
const loading = ref(true);
45-
const visible = computed(() => !ctl.onlyFullscreen);
4645
4746
const headerEl = computed(() => header.value?.$el);
4847
const containerLayout = computed({
@@ -85,8 +84,6 @@
8584
}
8685
});
8786
resizeObserver.value.observe(containerEl);
88-
89-
9087
});
9188
9289
onBeforeUnmount(() => {

package/components/NanoMain/index.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
>
1717
<article
1818
ref="article"
19-
class="vp-doc VPDoc p-[calc(var(--base-size)*1)] md:p-[var(--main-padding)] text-[var(--base-size)]"
19+
class="vp-doc VPDoc text-[var(--base-size)]"
2020
:class="[ 'w-full' ]"
2121
style="white-space: wrap;"
22+
:style="{ padding: articlePadding }"
2223
>
2324
<Content ref="content"/>
2425
</article>
@@ -63,6 +64,9 @@
6364
}, 240);
6465
});
6566
67+
const resizeObserver = ref<ResizeObserver | null>(null);
68+
const articlePadding = ref<string>('calc(var(--base-size))');
69+
6670
onMounted(() => {
6771
setTimeout(() => {
6872
hashChange();
@@ -87,6 +91,18 @@
8791
// Scroll to target element
8892
scrollbars.value?.osInstance()?.elements()?.viewport?.scrollTo({ top: targetTop, behavior: 'smooth' });
8993
});
94+
95+
resizeObserver.value = new ResizeObserver((entries: ResizeObserverEntry[]) => {
96+
for (const entry of entries) {
97+
const { target } = entry;
98+
const { clientWidth } = target as HTMLElement;
99+
if (clientWidth < 1280) {
100+
articlePadding.value = 'calc(var(--base-size))';
101+
} else {
102+
articlePadding.value = 'calc(var(--base-size)) calc(var(--base-size) * 2)';
103+
}
104+
}
105+
});
90106
});
91107
92108
onUnmounted(() => {

package/components/NanoModal/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div
44
v-if="visible"
55
ref="modal"
6-
class="absolute"
6+
class="absolute rounded-6px shadow-[0_0_16px_4px_rgb(0,0,0,.24)]"
77
:style="{ ...layoutStyle, transition }"
88
>
99
<slot/>

0 commit comments

Comments
 (0)