首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Dart聚合物:将html文件绑定到脚本会导致包含"%5C“字符的bootstrap.dart中断

Dart聚合物:将html文件绑定到脚本会导致包含"%5C“字符的bootstrap.dart中断
EN

Stack Overflow用户
提问于 2015-03-10 12:16:55
回答 1查看 116关注 0票数 1

在做了Pub Get和Pub升级之后,我的定制聚合元素不再工作了。在我看来

代码语言:javascript
复制
<script type="application/dart" src="view.dart"></script>

被错误地解释。在我的index.html_bootstrap.dart中,它被列出为:import 'dialog%5Cview.dart' as smoke_1; "%5C“(\)无论如何都应该是斜杠(/),我很确定它不应该被转义。我在64位Windows的省道稳定版(1.8.5)和开发版(1.9.0)上试了一下。

我已经尝试将我的包恢复到以前的版本,但是由于我没有在我的pubspec文件中限制它们,所以我无法在更改之前确定哪个版本可以工作。在另一个省道聚合物项目,我正在工作,我使用相同的设置(延伸的聚合物元素),它仍然工作。index.html_bootstrap.dart中的等效位置是:import 'dialog/view.dart' as smoke_1;

(编辑)一些(缩短)代码:

/web/对话框/error/view.html

代码语言:javascript
复制
<link rel="import" href="packages/polymer/polymer.html">
<link rel="import" href="packages/paper_elements/paper_dialog.html">
<link rel="import" href="packages/core_elements/core_animated_pages.html">

<polymer-element name="error-view">
<template>
    <style>
        paper-dialog {
            margin-top: 20px;
            height: 400px;
            width: 600px; }     
    </style>
    <paper-dialog id="extendedNode" heading="{{dialogtitle}}" vertical autoCloseDisabled=true transition="paper-transition-center" opened=true>
      <content> 
      <core-animated-pages selected="{{page}}" valueattr="id" transitions="hero-transition cross-fade">
            <section id="0">
                    <p  cross-fade>A system error occured while connecting with the server.</p>
                    <br>
                    <p  cross-fade>Error message: {{dialogtext}}</p>
          </section>       
    </core-animated-pages>
    </content>
    </paper-dialog>
  </template>

<script type="application/dart" src="view.dart"></script>
</polymer-element>

/web/对话框/错误/view.dart

代码语言:javascript
复制
import 'package:polymer/polymer.dart';
import '../view.dart'; // <- the base class 'DialogView'

  @CustomTag('error-view')
  class ErrorView extends DialogView{

    ErrorView.created() : super.created(){
    componentName = 'error-view';
    this.dialogtitle = 'System Error';
  }

}

/web/对话框/view.dart

代码语言:javascript
复制
import 'package:polymer/polymer.dart';
import 'dart:html';
import 'package:intl/intl.dart';

import '../locale/de.dart' as de;

class DialogView extends PolymerElement {
   @observable int page;
   //there are a lot of helper functions and variables in here
}

我使用这些组件中的许多对扩展基本组件(它没有view.html,但只有一个允许我在一个列表中保存和操作不同对话框的view.dart )。在我完成Pub Get /升级之前,这个问题非常好,并且没有通过修复缓存来解决。使用类似结构的项目仍然工作良好。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-03-10 18:22:22

这就解决了这一问题:

pubspec.yaml

code_transformers:'<= 0.2.5‘

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28963510

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档