@idooel/components 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import EleTree from './src/index.vue'
2
-
3
- EleTree.install = Vue => Vue.component(EleTree.name, EleTree)
4
-
1
+ import EleTree from './src/index.vue'
2
+
3
+ EleTree.install = Vue => Vue.component(EleTree.name, EleTree)
4
+
5
5
  export default EleTree
@@ -1,30 +1,30 @@
1
- <template>
2
- <a-tree-node :key="node.key" :title="node.title">
3
- <a-icon slot="icon" type="carry-out" />
4
- <template v-if="node.children">
5
- <TreeNode
6
- v-for="(children, idx) in node.children"
7
- :key="idx"
8
- :node="children">
9
- </TreeNode>
10
- </template>
11
- <!-- <span slot="title" style="color: #1890ff">parent 1</span> -->
12
- </a-tree-node>
13
- </template>
14
-
15
- <script>
16
- export default {
17
- name: 'TreeNode',
18
- isTreeNode: true,
19
- props: {
20
- node: {
21
- type: Object,
22
- required: true
23
- }
24
- }
25
- }
26
- </script>
27
-
28
- <style scoped>
29
-
1
+ <template>
2
+ <a-tree-node :key="node.key" :title="node.title">
3
+ <a-icon slot="icon" type="carry-out" />
4
+ <template v-if="node.children">
5
+ <TreeNode
6
+ v-for="(children, idx) in node.children"
7
+ :key="idx"
8
+ :node="children">
9
+ </TreeNode>
10
+ </template>
11
+ <!-- <span slot="title" style="color: #1890ff">parent 1</span> -->
12
+ </a-tree-node>
13
+ </template>
14
+
15
+ <script>
16
+ export default {
17
+ name: 'TreeNode',
18
+ isTreeNode: true,
19
+ props: {
20
+ node: {
21
+ type: Object,
22
+ required: true
23
+ }
24
+ }
25
+ }
26
+ </script>
27
+
28
+ <style scoped>
29
+
30
30
  </style>
@@ -1,97 +1,97 @@
1
- <template>
2
- <div class="g-tree__wrapper">
3
- <a-tree
4
- v-if="innerTreeData.length"
5
- :tree-data="innerTreeData"
6
- @select="selectTreeNode"
7
- :replaceFields="replaceFields"
8
- :default-expanded-keys="defaultExpandedKeys"
9
- :default-selected-keys="defaultSelectedKeys"
10
- blockNode
11
- :show-icon="showIcon">
12
- <template #title="{ title }">
13
- <span :title="title" class="tree-node__title">
14
- {{ title }}
15
- </span>
16
- </template>
17
- <template slot="custom" slot-scope="{ scopedSlots }">
18
- <a-icon :type="scopedSlots.iconName"></a-icon>
19
- </template>
20
- </a-tree>
21
- </div>
22
- </template>
23
-
24
- <script>
25
- export default {
26
- name: 'ele-tree',
27
- props: {
28
- treeData: {
29
- type: Array,
30
- default: () => []
31
- },
32
- replaceFields: {
33
- type: Object,
34
- default: () => ({
35
- title: 'title',
36
- key: 'id',
37
- children: 'children'
38
- })
39
- },
40
- defaultExpandedKeys: {
41
- type: Array
42
- },
43
- defaultSelectedKeys: {
44
- type: Array
45
- },
46
- showIcon: {
47
- type: Boolean,
48
- default: true
49
- }
50
- },
51
- data () {
52
- return {}
53
- },
54
- computed: {
55
- innerTreeData () {
56
- return this.treeData
57
- // return [
58
- // {
59
- // title: 'parent 1',
60
- // key: 1,
61
- // scopedSlots: {
62
- // icon: 'custom',
63
- // iconName: 'smile-o'
64
- // },
65
- // children: [
66
- // {
67
- // title: '2',
68
- // key: 2,
69
- // scopedSlots: {
70
- // icon: 'custom',
71
- // iconName: 'frown-o'
72
- // }
73
- // }
74
- // ]
75
- // }
76
- // ]
77
- }
78
- },
79
- methods: {
80
- refreshTreeStatus (props = {}) {},
81
- selectTreeNode (selectedKeys, e) {
82
- this.$emit('select', selectedKeys, e)
83
- }
84
- }
85
- }
86
- </script>
87
-
88
- <style lang="scss" scoped>
89
- .g-tree__wrapper {
90
- overflow: hidden;
91
- ::v-deep .ant-tree-node-content-wrapper {
92
- text-overflow: ellipsis;
93
- overflow: hidden;
94
- white-space: nowrap;
95
- }
96
- }
1
+ <template>
2
+ <div class="g-tree__wrapper">
3
+ <a-tree
4
+ v-if="innerTreeData.length"
5
+ :tree-data="innerTreeData"
6
+ @select="selectTreeNode"
7
+ :replaceFields="replaceFields"
8
+ :default-expanded-keys="defaultExpandedKeys"
9
+ :default-selected-keys="defaultSelectedKeys"
10
+ blockNode
11
+ :show-icon="showIcon">
12
+ <template #title="{ title }">
13
+ <span :title="title" class="tree-node__title">
14
+ {{ title }}
15
+ </span>
16
+ </template>
17
+ <template slot="custom" slot-scope="{ scopedSlots }">
18
+ <a-icon :type="scopedSlots.iconName"></a-icon>
19
+ </template>
20
+ </a-tree>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ export default {
26
+ name: 'ele-tree',
27
+ props: {
28
+ treeData: {
29
+ type: Array,
30
+ default: () => []
31
+ },
32
+ replaceFields: {
33
+ type: Object,
34
+ default: () => ({
35
+ title: 'title',
36
+ key: 'id',
37
+ children: 'children'
38
+ })
39
+ },
40
+ defaultExpandedKeys: {
41
+ type: Array
42
+ },
43
+ defaultSelectedKeys: {
44
+ type: Array
45
+ },
46
+ showIcon: {
47
+ type: Boolean,
48
+ default: true
49
+ }
50
+ },
51
+ data () {
52
+ return {}
53
+ },
54
+ computed: {
55
+ innerTreeData () {
56
+ return this.treeData
57
+ // return [
58
+ // {
59
+ // title: 'parent 1',
60
+ // key: 1,
61
+ // scopedSlots: {
62
+ // icon: 'custom',
63
+ // iconName: 'smile-o'
64
+ // },
65
+ // children: [
66
+ // {
67
+ // title: '2',
68
+ // key: 2,
69
+ // scopedSlots: {
70
+ // icon: 'custom',
71
+ // iconName: 'frown-o'
72
+ // }
73
+ // }
74
+ // ]
75
+ // }
76
+ // ]
77
+ }
78
+ },
79
+ methods: {
80
+ refreshTreeStatus (props = {}) {},
81
+ selectTreeNode (selectedKeys, e) {
82
+ this.$emit('select', selectedKeys, e)
83
+ }
84
+ }
85
+ }
86
+ </script>
87
+
88
+ <style lang="scss" scoped>
89
+ .g-tree__wrapper {
90
+ overflow: hidden;
91
+ ::v-deep .ant-tree-node-content-wrapper {
92
+ text-overflow: ellipsis;
93
+ overflow: hidden;
94
+ white-space: nowrap;
95
+ }
96
+ }
97
97
  </style>
@@ -1,5 +1,5 @@
1
- import EleTreeTableModel from './src/index.vue'
2
-
3
- EleTreeTableModel.install = Vue => Vue.component(EleTreeTableModel.name, EleTreeTableModel)
4
-
1
+ import EleTreeTableModel from './src/index.vue'
2
+
3
+ EleTreeTableModel.install = Vue => Vue.component(EleTreeTableModel.name, EleTreeTableModel)
4
+
5
5
  export default EleTreeTableModel