我试图在 Meteoric IonPopup 中有一个评级表。我有一个按钮来显示表单:
Template.thing.events({
'click [data-action="showReview"]': function(event, template) {
IonPopup.show({
title: 'Leave a review',
cssClass : '',
templateURL: 'reviewPopup.html',
buttons: [{
text: 'Cancel',
type: 'button-default',
onTap: function(e) {
e.preventDefault();
}
}, {
text: 'OK',
type: 'button-positive',
onTap: function(e) {
return scope.data.response;
}
}]
});
}
});
理想情况下应该将 reviewPopup.html 放在正文中
reviewPopup.html
<template name="reviewPopup">
{{#if currentUser}}
Rating: {{> rating}}
{{/if}}
</template>
<template name="rating">
<div class="rateit"></div>
</template>
但是我似乎无法让 templateURL 选项起作用。两个模板都在同一个目录中。我认为我给它一个文件名并且它只是将该文件的内容插入正文中是否正确?IonPopup.show 的文档说:
templateUrl: '', // String (optional). The URL of an html template to place in the popup body.