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 效果:
相关文章
相关标签/搜索