Skip to content

Commit

Permalink
update markmap
Browse files Browse the repository at this point in the history
  • Loading branch information
Xicheng Guo committed Jun 25, 2024
1 parent d28154c commit f701341
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions src/MarkMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,10 @@ export default {
// 添加Toolbar
function addToolbar(markmap) {
const js = document.createElement('div');
js.innerHTML = 'JS';
js.setAttribute('style', 'cursor: pointer;');
const all = document.createElement('div');
all.innerHTML = 'All';
all.setAttribute('style', 'cursor: pointer;');
const react = document.createElement('div');
react.innerHTML = 'React';
react.setAttribute('style', 'cursor: pointer;');
const vue = document.createElement('div');
vue.innerHTML = 'Vue';
vue.setAttribute('style', 'cursor: pointer;');
const js = createElementDiv('JS');
const all = createElementDiv('All');
const react = createElementDiv('React');
const vue = createElementDiv('Vue');
Toolbar.defaultItems = [{
content: js,
title: 'JavaScript',
Expand Down Expand Up @@ -125,6 +114,13 @@ export default {
toolbar.el.style.right = '0.5rem';
document.getElementById('container').appendChild(toolbar.el);
}
function createElementDiv(title) {
const div = document.createElement('div');
div.innerHTML = title;
div.setAttribute('style', 'cursor: pointer;');
return div;
}
}
};
</script>

0 comments on commit f701341

Please sign in to comment.