Skip to content

Commit

Permalink
refactor: 调整目录结构
Browse files Browse the repository at this point in the history
  • Loading branch information
shinetingli committed Feb 4, 2023
1 parent 93c5a98 commit 1d68b82
Show file tree
Hide file tree
Showing 42 changed files with 385 additions and 10,373 deletions.
9 changes: 9 additions & 0 deletions examples/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
<init-data-example></init-data-example>
<!-- <init-tree-data-example></init-tree-data-example> -->
</template>

<script lang="ts" setup>
import InitDataExample from "./init-data-example.vue";
import InitTreeDataExample from "./init-treedata-example.vue";
</script>
File renamed without changes.
File renamed without changes
File renamed without changes.
23 changes: 23 additions & 0 deletions examples/init-data-example.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<draggable-tree :init-data="initObject" @change="handleChange" />
</template>

<script lang="ts" setup>
import DraggableTree from "../packages/components/draggable-nested-tree/index.vue";
const initObject = {
Shrek: {},
Fiona: {
"Prince Charming": {
LordFarquad: "测试1",
LordLogo: "测试2",
},
},
Donkey: [],
Yes: [],
};
const handleChange = (data: any) => {
console.log(data);
};
</script>
56 changes: 7 additions & 49 deletions src/index.vue → examples/init-treedata-example.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
<template>
<draggable-tree :init-data="obj" @change="handleChange" />
<draggable-tree :init-tree-data="initTreeData" @change="handleChange" />
</template>

<script lang="ts" setup>
import { ref } from "vue";
import DraggableTree from "./components/draggable-nested-tree/index.vue";
import DraggableTree from "../packages/components/draggable-nested-tree/index.vue";
const handleChange = (data: any) => {
console.log(data);
};
const obj = {
Shrek: {},
Fiona: {
"Prince Charming": {
LordFarquad: "测试1",
LordLogo: "测试2",
},
},
Donkey: [],
Yes: [],
};
const list = ref([
const initTreeData = ref([
{
id: 1,
key: "Shrek",
Expand Down Expand Up @@ -72,34 +56,8 @@ const list = ref([
children: [],
},
]);
</script>
<style scoped>
.button {
margin-top: 35px;
}
.handle {
float: left;
padding-top: 8px;
padding-bottom: 8px;
}
.close {
float: right;
padding-top: 8px;
padding-bottom: 8px;
}
input {
display: inline-block;
width: 50%;
}
.text {
margin: 20px;
}
.list-group {
}
.list-group-item {
height: 50px;
cursor: pointer;
}
</style>
const handleChange = (data: any) => {
console.log(data);
};
</script>
6 changes: 6 additions & 0 deletions examples/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createApp } from "vue";
import App from "./App.vue";

import "./assets/main.css";

createApp(App).mount("#app");
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<script type="module" src="/examples/main.ts"></script>
</body>
</html>
Loading

0 comments on commit 1d68b82

Please sign in to comment.