gpt4 book ai didi

dart - Web组件应该放在 "web"文件夹下吗?

转载 作者:行者123 更新时间:2023-12-02 00:13:09 25 4
gpt4 key购买 nike

目的是将web组件放在某处的web文件夹下,还是放在lib文件夹下?

我问是因为我不确定,而且据我所知没有提到。

最佳答案

将你的组件放在lib目录下。

lib/
control1.html
control2.html
control3.html

假设您配置了 pubspec.yaml 文件并将包命名为“my_controls”。

name: my_controls
dependencies:
html5lib: '>=0.3.1+2'
web_ui: '>=0.3.2'

由于您的项目现在定义了一个包,您可以将 lib 目录中的文件引用为:

<link rel="components" href="packages/my_controls/control1.html">
<link rel="components" href="packages/my_controls/control2.html">
<link rel="components" href="packages/my_controls/control3.html">

关于dart - Web组件应该放在 "web"文件夹下吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14483755/

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