Skip to content

Commit

Permalink
readme完善
Browse files Browse the repository at this point in the history
  • Loading branch information
mingkun.chen authored and mingkun.chen committed Oct 9, 2022
1 parent d3550bf commit fd331ab
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
# commonJS
常用JS工具类整理

常用 JS 工具类整理
例,vue 项目中,可以直接放在 utils 文件夹下,在 main.js 中引入;
绑在在原型中,直接使用。
示例:
step1:main.js;

<!-- 引入 -->

import BaseCommon from '@/utils/baseCommon';

<!-- 绑定 -->

Vue.prototype.$baseCommon = BaseCommon;

step2:其他页面调用(使用):

<!-- this.$baseCommon.baseCommon.js 中的方法名 -->

this.$baseCommon.userBrowser();

0 comments on commit fd331ab

Please sign in to comment.