uview-plus icon indicating copy to clipboard operation
uview-plus copied to clipboard

v-calendar插件在页内插入模式的bug

Open gaohuacq opened this issue 3 months ago • 1 comments

如果使用页内插入模式,并且把u-calendar组件放在一个没有打开的弹窗中,由于弹窗在挂载时被隐藏的原因获取不到this.width的宽度,会导致每月的第一天的margin-left属性为0。 页面大概结构如下:

<template>
<view><u-popup v-show="show"><u-calendar :show="true" :pageInline="true" /></u-popup></view>
</template>
<script setup lang="ts">
import { vue } from 'vue'
const show = ref(false)
</script>

我目前的解决办法是在u-calendar上用v-if判断,这样就不会在不需要展示的时候去获取宽度了。修改方案是否可以新增一个props来设置默认宽度?

Image

gaohuacq avatar Sep 25 '25 00:09 gaohuacq

可以v-if="show"同步

ijry avatar Oct 20 '25 14:10 ijry