从react组件调用外部Javascript函数
对于typescript用户,请尝试以下操作:
declare global {
interface Window {
externalMethod: (params: any) => void;
}
}
那么您就可以在react组件中这样调用它
window.externalMethod(params)
http://ask.sov5.cn/q/strYVMW0iE
对于typescript用户,请尝试以下操作:
declare global {
interface Window {
externalMethod: (params: any) => void;
}
}
那么您就可以在react组件中这样调用它
window.externalMethod(params)
http://ask.sov5.cn/q/strYVMW0iE