【发布时间】:2017-11-27 11:11:39
【问题描述】:
我想在我的聚合物元素中使用 trumbowyg.js,它包括 jquery.js 和 trumbowyg.js。它在 Firefox 中运行良好,但在 chrome 中不行。
它给出了错误,可能是因为 chrome 中的 shadow dom 查找/分离。错误发生在 trumbowyg.js 使用“this”的地方。
这里出了什么问题?我应该怎么做?
我正在使用 Polymer 2.0
错误:
未捕获的类型错误:无法读取未定义的属性“toLowerCase” 在 trumbowyg.js:1544
我的笔记.html
<link rel="import" href="../polymer/polymer-element.html">
<link rel="import" href="../bower_components/trumbowyg/trumbowyg.html">
<dom-module id="my-notes">
<template>
<link rel="stylesheet" href="../bower_components/trumbowyg/dist/ui/trumbowyg.min.css">
<firebase-auth user="{{user}}" signed-in="{{signedIn}}"></firebase-auth>
<div class="card">
<div id="trumbowygd">hello</div>
</div>
</template>
<script>
class MyNotes extends Polymer.Element {
static get is() { return 'my-notes'; }
static get properties() {
return {
user: {
type: Object,
observer: '_shownotearea'
},
};
}
_shownotearea(){
var myFineElement = this.$.trumbowygd;
myFineElement.innerHTML="hello nice meeting you";
$(myFineElement).trumbowyg({});
}
</script>
</dom-module>
trumbowyg.html
<script src="../jquery/dist/jquery.min.js"></script>
<script src="dist/trumbowyg.js"></script>
【问题讨论】:
标签: polymer polymer-2.x trumbowyg