Skip to content

Commit 491146d

Browse files
committedNov 5, 2021
add arrDeepEach objEach methods
1 parent dfc3224 commit 491146d

File tree

12 files changed

+4920
-6914
lines changed

12 files changed

+4920
-6914
lines changed
 

‎.eslintrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ module.exports = {
1515
'vue',
1616
],
1717
rules: {
18+
'import/no-unresolved': 0,
19+
'guard-for-in': 0,
20+
'no-restricted-syntax': 0,
21+
'no-console': 0,
1822
'no-param-reassign': 0,
1923
'no-use-before-define': 0,
24+
'import/extensions': 0,
2025
'import/prefer-default-export': 0,
2126
},
2227
};

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# mixed-congee
22
mixed-congee
33

4+

‎example/vue/main.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { createApp } from 'vue'; // Vue 3.x 引入 vue 的形式
2-
import App from './src/App.vue'; // 引入 APP 页面组建
1+
import { createApp } from 'vue';
2+
import App from './src/App.vue';
3+
import mc from '../../index';
34

4-
const app = createApp(App); // 通过 createApp 初始化 app
5-
app.mount('#root'); // 将页面挂载到 root 节点
5+
const app = createApp(App);
6+
app.config.globalProperties.$mc = mc;
7+
app.mount('#root');

‎example/vue/src/app.vue

+8-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
<template>
22
<div>
3-
{{ name }}
3+
app
44
</div>
55
</template>
66
<script>
7-
export default {
7+
import { getCurrentInstance, defineComponent } from 'vue';
8+
9+
export default defineComponent({
810
name: 'App',
9-
data() {
10-
return {
11-
name: '12',
12-
};
13-
},
1411
setup() {
15-
const testFunction = () => {
16-
console.log('滚!!!');
17-
};
18-
return {
19-
testFunction,
20-
};
12+
const current = getCurrentInstance();
13+
current.proxy.$mc.objEach({ a: '1' }, (v, k) => {
14+
});
2115
},
22-
};
16+
});
2317
</script>
2418
<style></style>

‎index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import file from './src/utils/index';
1+
import { fileDown } from '@/utils/file';
2+
import { arrDeepEach } from '@/utils/array';
3+
import { objEach } from '@/utils/object';
24

35
export default {
4-
file,
6+
fileDown,
7+
arrDeepEach,
8+
objEach,
59
};

0 commit comments

Comments
 (0)
Please sign in to comment.