我正在尝试调用uploadFile('cde')方法来传递一些对象。
如何调用uploadFile('cde')。
<head>
<script>document.write('<script src="/assets/js/editor.js?v=' + Date.now() + '"><\/script>');</script>
</head>
<body>
<script type="text/javascript">
(function () {
window['uploadFiles'] = function () {
alert('hi'); <=== sucessfully getting alert
uploadFile('cde');<=== call from here
}
})();
</script>
</body>
var nicUploadButton = nicEditorAdvancedButton.extend({
uploadFile: function (obj) {
alert('cde') <=== this needs to be called
}
})
答案 0 :(得分:0)
在处理库时,您需要:
npm install @yourLibrary --save dev
然后应将此库导入组件:
import * as yourLib from 'yourLibrary';
,并在yourComponent中使用其方法:
yourLib.uploadFile('cde');