VisActor / VisActor/VTable

createImage 如何设置默认展示的兜底图

Open
#4,971 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.7k
Forks
486
Avg merge
1d 19h
Merged PRs (30d)
16

Description

const createImageWithFallback = (options: any, fallbackImage?: string) => {
const image = createImage({ image: defaultImage, ...options});
(image as any).failCallback = () => {
image.setAttribute('image', fallbackImage || defaultImage);
};
return image;
}

export default createImageWithFallback;
直接设置也不生效,加载还是显示默认的图

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the provided createImageWithFallback snippet and inspect createImage and its failCallback handling. Reproduce an image-load failure, determine why setting the image attribute does not replace the default image, and verify that the configured fallbackImage is displayed when loading fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.