demo.js:
export function a(b) { alert(b); }
test.vue:
let a = 1;
if (a == 1) {
require('../../api/demo/demo.js').a(111);
}
else {
require('../../api/demo/demo2.js');
}
结果:弹窗:111
demo.js:
export function a(b) { alert(b); }
test.vue:
let a = 1;
if (a == 1) {
require('../../api/demo/demo.js').a(111);
}
else {
require('../../api/demo/demo2.js');
}
结果:弹窗:111