我试图重构一些dart-polymer组件以使用@HtmlImport注释。
.dart
part of epimss_shared.components;
@CustomTag('associated-symptoms-form')
class AssociatedSymptomsForm extends PolymerElement {
AssociatedSymptomsForm.created() : super.created();
@override
void attached() {
super.attached();
}
}
html的
<polymer-element name='associated-symptoms-form'>
<template>
<div layout horizontal center>
<h1>Symptoms</h1>
</template>
<script type = 'application/dart' src='associated_symptoms_form.dart'></script>
</polymer-element>
文库
图书馆epimss_shared.components;是导入的epimss.shared库的一部分。
@HtmlImport('../components/tooltip/tool_tip.html')
@HtmlImport('../components/misc/associated_symptoms_form.html')
library epimss_shared.components;
import 'dart:html' as dom;
import 'package:polymer/polymer.dart';
import 'package:epimss_shared/epimss_shared.dart';
import 'package:epimss_shared/epimss_shared_client.dart';
part '../components/tooltip/tool_tip.dart';
part '../components/misc/associated_symptoms_form.dart';
当我尝试使用该组件时,不会显示以下控制台错误的应用程序:
'package:epimss_shared/components/misc/associated_symptoms_form.dart': error: line 1 pos 6: url expected
part of epimss_shared.components;
^: package:epimss_shared/components/misc/associated_symptoms_form.dart
似乎该组件的先前信息已缓存并正在重复使用。
感谢任何帮助。