1、还是上个效果图
2、增加行以后的高度
3、具体实现
定义一个computed变量entryHeight,然后自动计算即可。
4、代码实现
方式一:computed
const entryHeight = computed(() => {
return entrys.length == 0 ? 250 : entrys.length * 50 + 200;
});
具体的值可以根据实现情况进行调整。
方式二:watch
const entryHeight = ref(250)
watch(entrys,()=>{
entryHeight.value = entrys.length == 0 ? 250 : entrys.length * 50 + 200;
});