Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"presets": [
["env", { "modules": false }]
["@babel/preset-env",{
modules:false,
}]
]
}
8 changes: 6 additions & 2 deletions App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
@item-drag-end="itemDragEnd"
@item-drop-before = "itemDropBefore"
@item-drop="itemDrop">
<template slot-scope="_">
<template #default="_">
<div style="display: inherit; width: 200px" @click.ctrl="customItemClickWithCtrl">
<i :class="_.vm.themeIconClasses" role="presentation" v-if="!_.model.loading"></i>
{{_.model.text}}
Expand Down Expand Up @@ -182,7 +182,11 @@
</template>

<script>
import VJstree from './src/index.js';
export default {
components: {
'v-jstree':VJstree
},
name: 'app',
data () {
return {
Expand Down Expand Up @@ -479,7 +483,7 @@
]
this.$refs.tree2.handleAsyncLoad(this.asyncData, this.$refs.tree2)
},
customItemClick: function (node ,item, e) {
customItemClick: function (node, item, e) {
e.stopPropagation()
var index = node.parentItem.indexOf(item)
node.parentItem.splice(index, 1)
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Introduction

A tree plugin for vue2
A tree plugin for vue3

<img src="./pic.png" width="100%" align=center />

Expand Down Expand Up @@ -194,7 +194,7 @@ A tree plugin for vue2

```
<v-jstree :data="data">
<template scope="_">
<template #default="_">
<div style="display: inherit; width: 200px" @click.ctrl="customItemClickWithCtrl">
<i :class="_.vm.themeIconClasses" role="presentation" v-if="!_.model.loading"></i>
{{_.model.text}}
Expand All @@ -209,7 +209,7 @@ more elegant:

```
<v-jstree :data="data">
<template scope="_">
<template #default="_">
<div style="display: inherit; width: 200px" @click.ctrl="customItemClickWithCtrl" @click.exact="customItemClick(_.vm, _.model, $event)">
<i :class="_.vm.themeIconClasses" role="presentation" v-if="!_.model.loading"></i>
{{_.model.text}}
Expand All @@ -218,10 +218,8 @@ more elegant:
</v-jstree>
```

**scope** be replaced in the **[email protected]+** , over **[email protected]+** use **slot-scope**

## License

Licensed under the [MIT license](https://opensource.org/licenses/mit-license.php).

Thanks For [jstree](https://github.com/vakata/jstree)'s UI
Thanks For [jstree](https://github.com/vakata/jstree)'s UI
2 changes: 1 addition & 1 deletion dist/vue-jstree.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-jstree.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</head>
<body>
<div id="app"></div>
<script src="/dist/vue-jstree.js"></script>
<script src="dist/vue-jstree.js"></script>
</body>
</html>
15 changes: 6 additions & 9 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import Vue from 'vue'

import VJstree from './src/index.js'
Vue.use(VJstree)

import {createApp,h} from 'vue'
import App from './App.vue'

new Vue({
el: '#app',
render: h => h(App)
})
var app = createApp({
render: () => h(App)
});

app.mount('#app');
Loading