test.js文件(公共js文件)
// 1 function myFun() { console.log('this is my function') } export { myfun } // 2 export function myFun() { console.log('this is my function') }
在需要使用該方法的頁面中
import { myFun} from 'path' // 使用 myFun()
test.js文件(公共js文件)
// 1 function myFun() { console.log('this is my function') } export { myfun } // 2 export function myFun() { console.log('this is my function') }
在需要使用該方法的頁面中
import { myFun} from 'path' // 使用 myFun()
https://blog.csdn.net/u013129300/article/details/129329786