Skip to content

Commit

Permalink
外置jQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
tower1229 committed Jul 15, 2022
1 parent dfd006e commit 2785d7b
Show file tree
Hide file tree
Showing 22 changed files with 1,972 additions and 22,663 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ ztree 在性能优化方面已经做到了近乎极致,感谢 ztree 作者的
npm i vue-giant-tree --save
```

**注意:组件依赖 jQuery,务必在页面中提前加载 jQuery**

```
<script src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
```

## 使用

in script:
Expand Down
38 changes: 8 additions & 30 deletions dist/demo.html
Original file line number Diff line number Diff line change
@@ -1,41 +1,19 @@
<meta charset="utf-8">
<title>vue-giant-tree demo</title>
<script src="https://unpkg.com/vue"></script>
<script src="//unpkg.com/vue@2"></script>
<script src="./vue-giant-tree.umd.js"></script>


<div id="app">
<demo :nodes="simpleData" />
<demo></demo>
</div>

<script>
const vueGiantTree = window['vue-giant-tree']

const simpleData = [
{ id: 1, pid: 0, name: "随意勾选 1", open: true },
{ id: 11, pid: 1, name: "随意勾选 1-1", open: true },
{ id: 111, pid: 11, name: "随意勾选 1-1-1" },
{ id: 112, pid: 11, name: "随意勾选 1-1-2" },
{ id: 12, pid: 1, name: "随意勾选 1-2", open: true },
{ id: 121, pid: 12, name: "随意勾选 1-2-1" },
{ id: 122, pid: 12, name: "随意勾选 1-2-2" },
{ id: 2, pid: 0, name: "随意勾选 2", checked: true, open: true },
{ id: 21, pid: 2, name: "随意勾选 2-1" },
{ id: 22, pid: 2, name: "随意勾选 2-2", open: true },
{ id: 221, pid: 22, name: "随意勾选 2-2-1", checked: true },
{ id: 222, pid: 22, name: "随意勾选 2-2-2" },
{ id: 23, pid: 2, name: "随意勾选 2-3" }
];
new Vue({
components: {
demo: vue-giant-tree
}
}).$mount('#app')


new Vue({
data() {
return {
simpleData
}
},
components: {
demo: vueGiantTree
}
}).$mount('#app')
</script>
</script>
Loading

0 comments on commit 2785d7b

Please sign in to comment.