commonjs
export default {
fn1(vueObject){
let that = vueObject
//在方法中使用that是vue组件传过来的this,使用this是该公共类的就是对象,要使用该类中别的方法可以使用this.fn2()
that.getDataNum = that.GLOBALjs.getDataNum
},
fn2(){},
...
}
vue
import commonFunction from '@/views/rue/js/common.js'
methods: {
stopAudio(item){
commonFunction.stopAudio(this,item)
}
}