element-plus [Component] [loading] V-Loading does not hide content at beginning

uxhixvfz  于 5个月前  发布在  其他
关注(0)|答案(2)|浏览(60)

Bug Type: Component

Environment

  • Vue Version: 3.3.4
  • Element Plus Version: 2.3.5
  • Browser / OS: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/110.0
  • Build Tool: Vite

Reproduction

  • el-loading

Element Plus Playground

Steps to reproduce

Use v-loading on a div.

<script lang="ts">
const loading: Ref<boolean> = ref(true);
</script>

<template>
    <div v-loading=loading>
  	<h2>
           I should never be seen
        </h2>
    </div>
</template>

What is Expected?

V-Loading should hide the content from the beginning when v-loading=true

What is actually happening?

V-Loading takes too long to show up, therefore a flash can be seen where the content to hide is visibile.

Additional comments

This makes setups like

<div
    v-loading="loading"
>
    <div
        v-if="!data"
    >
        Error loading data
    </div>
    <div
        v-else
    >
        {{ data }}
    </div>
</div>

not usable as Error loading data is flashed briefly in such a case.

loading-bug.mov

I should never be seen can be seen un-hidden briefly.

ds97pgxw

ds97pgxw1#

How about specifying min-height ?

flashed can be reduced.

bf1o4zei

bf1o4zei2#

How about specifying min-height ?

flashed can be reduced.

Not really

https://element-plus.run/#eyJzcmMvQXBwLnZ1ZSI6IjxzY3JpcHQgc2V0dXAgbGFuZz1cInRzXCI+XG5pbXBvcnQgeyByZWYsIHZlcnNpb24gYXMgdnVlVmVyc2lvbiB9IGZyb20gJ3Z1ZSdcbmltcG9ydCB7IHZlcnNpb24gYXMgRXBWZXJzaW9uIH0gZnJvbSAnZWxlbWVudC1wbHVzJ1xuaW1wb3J0IHsgRWxlbWVudFBsdXMgfSBmcm9tICdAZWxlbWVudC1wbHVzL2ljb25zLXZ1ZSdcbmltcG9ydCB0eXBlIHsgVXBsb2FkVXNlckZpbGUgfSBmcm9tIFwiZWxlbWVudC1wbHVzXCI7XG4gIFxuY29uc3Qgc3VibWl0VXBsb2FkID0gKCkgPT4ge1xufVxuY29uc3QgZmlsZUxpc3Q6IFJlZjxVcG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