vue注册全局方法
vue注册全局方法
//全局函数-main.js import fns from './config/fns' Object.keys(fns).forEach(key => { Vue.prototype[key] = fns[key] }) //fns定义全局函数 //使用箭头函数不能拿到this export default { //提示错误 toastErrMsg: function (text) { this.$vux.toast.show({ type: 'warn', width: '12em', time: 1500, text: text }) }, hidekeyboard() { window.scrollTo(0, 0); }, }

浙公网安备 33010602011771号