gpt4 book ai didi

Dartlang 附加链接到 LIElement

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

有没有可能把LIElement做成链接,怎么做?

我努力了

var li = new LIElement();
li.text = text;
li.href = "http://www.google.com";

但它似乎不起作用。

任何帮助将不胜感激。

最佳答案

你必须添加一个 anchor 元素,就像你在 HTML 中做的那样。

LIElement li = new LIElement();
AnchorElement a = new AnchorElement();
a.text = "I'm a <li> with an <a>!";
a.href = "http://www.google.com";
li.append(a);

关于Dartlang 附加链接到 LIElement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20283466/

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