-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |