Hi guys, I try to call jq-signature on popup component. It can only works on dynamic creating mode. But it did not call the func outside the creating function. my test code as follow :
createPopup: function () {
const that = this;
//
if(!that.popup) {
that.popup = that.$f7.popup.create({
content:'' +
'<div class="popup">\n' +
' <div class="page">\n' +
' <div class="navbar">\n' +
' <div class="navbar-inner">\n' +
' <div class="title">Dynamic Popup</div>\n' +
' <div class="right"><a href="#" class="link popup-close">Close</a></div>\n' +
' </div>\n' +
' </div>\n' +
' <div class="page-content">\n' +
' <div class="block">\n' +
' <div class="js-signature"\n' +
' data-width="400"\n' +
' data-height="200"\n' +
' data-border="1px solid #1ABC9C"\n' +
' data-background="#aaa"\n' +
' data-line-color= \'#ABCDEF\'\n' +
' data-auto-fit="true"></div>' +
//
' <p><button id="clearBtn" @click="clearCanvas();">清空</button>' +
' <button id="saveBtn" @click="saveSignature();" disabled>保存</button></p>\n' +
' <div id="signature"></div>' +
' </div>\n' +
' </div>\n' +
' </div>\n' +
'</div>' +
''.trim(),
});
}
that.popup.open();
$('.js-signature').jqSignature({width: 400});
$('.js-signature').on('jq.signature.changed', function() {
$('#saveBtn').attr('disabled', false);
});
},
I mean function “clearCanvas” and “saveSignature” did not works.
I will appreciate if there have any reply.