dart web ui webcomponents 将来扩展 html 元素

标签 dart dart-webui

我在 darts web ui 介绍页面上读到了这篇文章。

The constructor attribute indicates the class that defines this component’s behavior (for example, “CounterComponent”). Today, this class must be a subclass of WebComponent, but in the future it will be possible to use a subclass of the HTML element declared in the extends attribute. In the preceding example, that would mean class CounterComponent extends DivElement ....

他们是否说过何时安排此更改以及是否需要重写扩展 WebComponent 的旧组件?

最佳答案

我不知道何时/是否会发生这种情况,但 WebComponent 类具有以下注释:

  /**
   * Temporary property until components extend [Element]. An element can
   * only be associated with one host, and it is an error to use a web component
   * without an associated host element.
   */
  Element get host { ... }

因为它说“临时”,我想如果您的代码明确引用主机,则需要进行一些更改。

关于dart web ui webcomponents 将来扩展 html 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16721882/

相关文章:

dom - 为什么Target 8文件没有按照教程中的描述实现项目?

dart - Web 组件中的自定义事件?

flutter - 如何根据屏幕尺寸抖动设置小部件位置

dart - 将Web组件添加到DOM

flutter - 如何在 Flutter 中获取下载路径?

kotlin - 从 Dart 向 Kotlin 发送回调函数

websocket - Dart 如何编写一个简单的 web-socket echo 应用程序

recursion - Dart 模板可以处理递归混合结构吗?

dart - 在 Dart 中自动化 JavaScript 互操作

mysql - Dart SqlJocky - 数据库没有响应