index.uts代码
export function test(p:string = "test"):void{
console.log(p);
}
export class Text{
constructor(){
}
classtest(p:string = "classtest"):void{
console.log(p);
}
}
js代码,调用test函数是正常的,调用类方法classtest()会报“Error: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1”
import { TTS , test,Text} from "@/uni_modules/ns-tts"
test()
new Text().classtest()
1 个回复
2***@qq.com (作者)
一般来说,函数和类方法是差不多的,这差异有点大了