Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] When el-image in a dynamic element, the image will request twice #23019

Open
candisecandise opened this issue Jan 3, 2025 · 0 comments

Comments

@candisecandise
Copy link

candisecandise commented Jan 3, 2025

Element UI version

2.15.14

OS/Browsers version

chrome 131.0.6778.108

Vue version

2.6.11

Reproduction Link

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vue Element Image Example</title>
  <!-- 引入 Vue -->
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js"></script>
  <!-- 引入 Element UI -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/lib/theme-chalk/index.css">
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/index.js"></script>
</head>
<body>
  <div id="app">
    <div v-if="task.length > 0">
      <el-image
        style="width: 100px; height: 100px"
        src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTYqp-HBvpGNSDFZmiVM0Inc46juNZ2RhoJzhVvNW9OLpdrSsiFMD5m-iw&usqp=CAU"
        fit="cover"
      >
      </el-image>
    </div>
    <div v-else>
      <p>Loading...</p>
    </div>
  </div>

  <script>
    new Vue({
      el: '#app',
      data: {
        task: []
      },
      mounted() {
        setTimeout(() => {
          this.task.push(1);
        }, 1000);
      }
    });
  </script>
</body>
</html>

Steps to reproduce

The same issue as #19712, the difference is when the el-image is in a dynamic element, the image will load twice.

What is Expected?

load once

What is actually happening?

load twice

image

@candisecandise candisecandise changed the title [Bug Report] el-image request twice [Bug Report] When el-image in a dynamic element, the image will request twice Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant