vue3.0全局函數定義

首先新建一個fnc.js測試   代碼:prototype   //測試調用方法 let test = str =>{ alert(str) }; export default { test } mian.jscode /** * 全局方法 */ import fnc from './base/fnc.js' Vue.prototype.$fnc=fnc; 頁面使用blog 效果:
相關文章
相關標籤/搜索