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

g-web-components 官方示例显示空白 #1882

Open
gslvly opened this issue Dec 27, 2024 · 1 comment
Open

g-web-components 官方示例显示空白 #1882

gslvly opened this issue Dec 27, 2024 · 1 comment
Labels

Comments

@gslvly
Copy link

gslvly commented Dec 27, 2024

代码如下,显示空白

<!DOCTYPE html>
<head>
  <title>Test G Web Component</title>
  <script src="https://unpkg.com/@antv/g"></script>
  <script src="https://unpkg.com/@antv/g-canvas"></script>
  <script src="https://unpkg.com/@antv/g-web-components"></script>
</head>
<body>
    <g-canvas renderer="canvas" width="400" height="400">
        <g-rect
            fill="#2f54eb"
            radius="0 24px 24px"
            x="12px"
            y="24px"
            width="200px"
            height="50px"
        >
            <g-circle fill="#adc6ff" r="16px" cx="25px" cy="25px"></g-circle>
            <g-text fill="#fff" x="50px" y="20px">我是一段文字</g-text>
        </g-rect>
    </g-canvas>
</body>```
@gslvly gslvly added the bug label Dec 27, 2024
Copy link

看起来您在使用 antvis/G 的 g-web-components 时遇到了问题,导致示例显示为空白。以下是一些可能的解决方案:

  1. 检查脚本加载顺序: 确保所有脚本都正确加载,并且没有网络问题导致脚本未能加载。

  2. 浏览器兼容性: 确保您使用的浏览器支持 Web Components。可以尝试在最新版本的 Chrome、Firefox 或 Edge 中运行代码。

  3. 调试信息: 打开浏览器的开发者工具(通常是按 F12 或右键选择“检查”),查看控制台是否有错误信息。

  4. 样式问题: 确保没有其他 CSS 样式影响了组件的显示。

如果这些方法都不能解决问题,请提供更多的错误信息或控制台输出,以便更好地帮助您解决问题。

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant