-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from baryla/update-method
Added ability to update data through an update method
- Loading branch information
Showing
7 changed files
with
15,866 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta charset="utf-8"> | ||
<title>Liquor Tree: Updating</title> | ||
<link rel="stylesheet" href="../assets/style.css"> | ||
<script src="../assets/menu.js"></script> | ||
|
||
<!-- first import Vue --> | ||
<!-- <script src="https://unpkg.com/vue/dist/vue.js"></script> --> | ||
<script src="../assets/vue.js"></script> | ||
<script src="/liquor-tree.umd.js"></script> | ||
</head> | ||
|
||
<body> | ||
<div class="hello"> | ||
Updating. | ||
</div> | ||
|
||
<div id="app"> | ||
<div class="examples"> | ||
<div class="example"> | ||
<div class="example-description"> | ||
Basic example | ||
</div> | ||
<div class="example-tree"> | ||
<tree ref="tree" :data="treeData" /> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<script> | ||
new Vue({ | ||
el: '#app', | ||
data: () => ({ | ||
treeData: [ | ||
{ text: 'Item 1' }, | ||
{ text: 'Item 2' }, | ||
{ text: 'Item 3', state: { selected: true } }, | ||
{ text: 'Item 4' } | ||
] | ||
}), | ||
mounted() { | ||
this.$nextTick(() => { | ||
this.$refs.tree.update('Item 1', node => { | ||
return { text: 'New Item!' }; | ||
}); | ||
}) | ||
} | ||
}) | ||
</script> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.