如何在胡椒插件API中添加自定义函数

How to add custom function in pepper plugin API

本文关键字:添加 自定义函数 API 插件 胡椒      更新时间:2023-09-26

作为标题,我可以在胡椒插件API中添加自定义函数吗?

自定义函数可以返回值吗?

喜欢这个

HelloTutorialModule = document.getElementById('hello_tutorial');
var errorCode;
errorCode = HelloTutorialModule.myCustomFunction('Hello');

谢谢

是的,你可以,因为document.getElementById会返回一个Object,如果它不freeze,你可以增强这个对象。

请参考我的演示