vue 全局 js 方法
1、新增 getCurrentDataType.js 文件
import cookieUtils from ‘@/config/cookieUtils‘ function getCurrentDataType () { let type = cookieUtils.get(‘curr_sjjc_data_type‘) if (type === ‘0‘ || type === ‘1‘) { return type } return ‘0‘ } export { getCurrentDataType }
2. 在main.js 中设置
import { getCurrentDataType } from ‘@/utils/getCurrentDataType.js‘ . . . . . . Vue.prototype.$getCurrentDataType = getCurrentDataType
vue 全局 js 方法
,温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/40707.html
- 上一篇:php上传图片,网站代码
- 下一篇:【js】字符串反转(倒序)的多种处理方式