Skip to content

Commit 9e8b992

Browse files
committed
add typings
1 parent 07453d6 commit 9e8b992

14 files changed

+31
-178
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ yarn add vue3-blocks-tree
109109

110110
``` js
111111
import {createApp} from 'vue';
112-
import VueBlocksTree from 'vue3-blocks-tree'
113-
112+
import VueBlocksTree from 'vue3-blocks-tree';
113+
import 'vue3-blocks-tree/dist/vue3-blocks-tree.css';
114+
// or import 'vue3-blocks-tree/src/styles/blocks-tree.less';
114115
createApp(App).component('blocks-tree',VueBlocksTree)
115116

116117
// ...

demo-dist/app.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/demo-app.vue

-1
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,3 @@ export default defineComponent({
8282
})
8383
8484
</script>
85-

demo/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import {createApp } from 'vue';
22
import VueBlocksTree from '../src';
3+
import '../src/styles/blocks-tree.less';
4+
35
import App from './demo-app.vue';
6+
7+
8+
49
createApp(App)
510
.component('blocks-tree',VueBlocksTree)
611
.mount('#app');

dist/vue3-blocks-tree-style.umd.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue3-blocks-tree.umd.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue3-blocks-tree",
3-
"version": "0.1.0",
3+
"version": "0.2.2",
44
"description": "A vue3 block organization tree view component. Hierarchical horizontal or vertical tree",
55
"main": "dist/vue3-blocks-tree.umd.min.js",
66
"author": "megafetis",
@@ -47,22 +47,25 @@
4747
"vue": "^3.0.0"
4848
},
4949
"bugs": {
50-
"url": "https://github.com/megafetis/v-org-tree/issues"
50+
"url": "https://github.com/megafetis/vue3-blocks-tree/issues"
5151
},
52-
"homepage": "https://github.com/megafetis/v-org-tree",
52+
"homepage": "https://github.com/megafetis/vue3-blocks-tree",
5353
"keywords": [
5454
"vue",
5555
"vue3",
5656
"next",
5757
"vue next",
5858
"tree",
5959
"org",
60+
"select",
61+
"tree select",
62+
"blocks",
6063
"hierarchy",
6164
"hierarchical"
6265
],
6366
"license": "MIT",
6467
"repository": {
6568
"type": "git",
66-
"url": "git+https://github.com/megafetis/v-org-tree.git"
69+
"url": "git+https://github.com/megafetis/vue3-blocks-tree.git"
6770
}
6871
}

src/components/org-tree/org-tree.vue src/components/blocks-tree/blocks-tree.vue

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="org-tree-container">
33
<div class="org-tree" :class="{horizontal, collapsable}">
4-
<org-tree-node
4+
<blocks-tree-node
55
:data="data"
66
:props="props"
77
:horizontal="horizontal"
@@ -18,19 +18,19 @@
1818
<template #node="{data,context}">
1919
<slot name="node" :data="data" :context="context"></slot>
2020
</template>
21-
</org-tree-node>
21+
</blocks-tree-node>
2222
</div>
2323
</div>
2424
</template>
2525

2626
<script lang="ts">
27-
import OrgTreeNode from './org-node.vue';
27+
import BlocksTreeNode from './blocks-node.vue';
2828
import {defineComponent} from 'vue';
2929
import {PropsType} from '../../../types/vue3-blocks-tree';
3030
export default defineComponent({
31-
name: 'Vue2OrgTree',
31+
name: 'Vue3BlocksTree',
3232
components: {
33-
OrgTreeNode
33+
BlocksTreeNode
3434
},
3535
props: {
3636
data: {
@@ -52,8 +52,4 @@ export default defineComponent({
5252
labelClassName: [Function, String],
5353
}
5454
})
55-
</script>
56-
57-
<style lang="less">
58-
@import '../../styles/org-tree';
59-
</style>
55+
</script>

src/components/org-tree/node.js

-156
This file was deleted.

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import Vue3OrgTree from './components/org-tree/org-tree.vue'
1+
import Vue3OrgTree from './components/blocks-tree/blocks-tree.vue';
22

3-
export default Vue3OrgTree
3+
export default Vue3OrgTree;
File renamed without changes.

types/index.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {NodeContext,PropsType} from './vue3-blocks-tree';
2+
3+
export {NodeContext,PropsType}

webpack.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module.exports = (env = {}) => ([{
1616
mode: env.production ? 'production' : 'development',
1717
entry: {
1818
"vue3-blocks-tree": './index.ts',
19+
"vue3-blocks-tree-style":"./styles/blocks-tree.less"
1920
},
2021
output: {
2122
path: path.resolve(__dirname, "dist"),
@@ -127,7 +128,7 @@ module.exports = (env = {}) => ([{
127128
plugins: [
128129
new CleanWebpackPlugin(),
129130
new MiniCssExtractPlugin({
130-
filename: '[name].css',
131+
filename: 'vue3-blocks-tree.css',
131132

132133
}),
133134
new WebpackBar(),

0 commit comments

Comments
 (0)