假如我现在有a.js 和 b.js 两个文件
在vue文件中引入 import (或者其他方式)
请问怎么样才能在a.js 中可以调用b.js中的方法
b.js 中也能调用a.js中的放啊。
菜鸟 勿喷,求大佬解答。
假如我现在有a.js 和 b.js 两个文件
在vue文件中引入 import (或者其他方式)
请问怎么样才能在a.js 中可以调用b.js中的方法
b.js 中也能调用a.js中的放啊。
菜鸟 勿喷,求大佬解答。
a.js中
import b from ./b
const a = {}
a.function1 = ()=>{b.funtion2()}
a.function2 = ()=>{console.log('a的function2')}
export default a
b.js中
import a from ./a
const b={}
b.function1 = ()=>{a.funtion2()}
b.function2 = ()=>{console.log('b的function2')}
export default b