gpt4 book ai didi

dart web ui webcomponents 将来会扩展 html 元素

转载 作者:行者123 更新时间:2023-12-03 02:54:17 25 4
gpt4 key购买 nike

我在 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 { ... }

由于它说“临时”,我想如果您的代码明确指的是 host ,将需要进行一些更改。

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com