下面是我的<template>代码:
<firebase-auth
id="auth"
app-name="notes"
provider="google"
signed-in="{{signedIn}}"
user="{{user}}">
</firebase-auth>
<firebase-document
id="document"
app-name="notes"
path="[[editableNoteId]]"
data="{{editableNote}}">
</firebase-document>
<na-editor
id="editor"
note="{{editableNote}}"
on-close="commitChange">
</na-editor>脚本:
<script>
Polymer({
is: 'note-app',
behaviors: [Polymer.NoteAppBehavior],
signIn: function() {
this.$.auth.signInWithPopup();
},
get notesPath() {
return '/notes/' + this.user.uid;
},
toEditableId: function(noteId) {
return this.notesPath + '/' + noteId;
}
});
</script>下面是错误:
TypeError: this.$.document.save is not a function. (In 'this.$.document.save(this.notesPath)', 'this.$.document.save' is undefined)注意: app-name和firebase-app已正确定义。
发布于 2017-04-18 06:29:20
在0.11.0版本中,save()方法被重命名为saveValue(),以保持与某些JS编译器和较旧浏览器的兼容性。详情请参见the release notes。
docs现在也显示了更新,但当你查看它们时可能还没有。
发布于 2017-04-19 01:26:25
将此代码添加到脚本中修复了此问题。
save: function() {
this.$.document.saveValue();
},https://stackoverflow.com/questions/43449313
复制相似问题