0

当尝试将 web 组件的 html 文件插入到我的应用程序库的视图目录中时,web_ui 编译器会抛出消息

FileIOException: Cannot retrieve full path for file 'lib\src\view\entity\base\packages' (OS Error: The system cannot find the file specified.

这是可以预料的吗?如果没有,我应该怎么做才能修复错误?

4

1 回答 1

1

由于我没有看到您的代码或项目,这只是一种预感。我相信您的 Web 组件 HTML 文件以错误的方式导入了一些组件。

尝试遵循以下结构:

/lib/src/view/foo/foo.html
/lib/src/view/foo/foo.dart

/lib/src/view/bar/bar.html
/lib/src/view/bar/bar.dart

在里面foo.html

<!DOCTYPE html>
<html>
  <head>
    <link rel="components" href="../bar/bar.html" />
  </head>
<body>
  <element name="x-foo" constructor="FooComponent" extends="div">
    <template>
      ...
    </template>
    <script type="application/dart" src="foo.dart"></script>
  </element>
</body>
</html>

请注意,我没有使用packagesin foo.html

于 2013-02-12T11:34:24.150 回答