-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3.7.0 add the fnCustomClasses property
- Loading branch information
yinquan
committed
Jul 13, 2021
1 parent
91aae9d
commit 6e728dc
Showing
13 changed files
with
142 additions
and
18 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
3.7.0 | ||
- 添加: | ||
- 属性 fnCustomClasses | ||
|
||
3.6.0 | ||
- 修正: | ||
- 编辑一个结点的标题时,输入框的宽度不能很好地适应内容的长度。 | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1 @@ | ||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>twtree</title><link href="css/app.571cd6dc.css" rel="preload" as="style"><link href="js/app.291f2d3f.js" rel="preload" as="script"><link href="js/chunk-vendors.c3eedee7.js" rel="preload" as="script"><link href="css/app.571cd6dc.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but twtree doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.c3eedee7.js"></script><script src="js/app.291f2d3f.js"></script></body></html> | ||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>twtree</title><link href="css/app.8cea11bb.css" rel="preload" as="style"><link href="js/app.52c6bc78.js" rel="preload" as="script"><link href="js/chunk-vendors.c3eedee7.js" rel="preload" as="script"><link href="css/app.8cea11bb.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but twtree doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.c3eedee7.js"></script><script src="js/app.52c6bc78.js"></script></body></html> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,90 @@ | ||
<template> | ||
<div class="example-wrapper"> | ||
<div class="panel"> | ||
<TWTree | ||
:tree="tree" | ||
:fnCustomClasses="fnCustomClasses" | ||
class="tree" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import TWTree from '../../src/TWTree.vue' | ||
export default { | ||
name: 'custom-appearance-custom-classes-example', | ||
components: { | ||
TWTree | ||
}, | ||
data() { | ||
return { | ||
tree: [ | ||
{ | ||
id: 1, | ||
title: 'ROOT', | ||
hasChild: true, | ||
children: [ | ||
{ | ||
id: 2, | ||
title: 'child 1', | ||
}, | ||
{ | ||
id: 3, | ||
title: 'child 2', | ||
hasChild: true, | ||
children: [ | ||
{ | ||
id: 4, | ||
title: 'child 2-1', | ||
type: 'red' | ||
}, | ||
{ | ||
id: 5, | ||
title: 'child 2-2', | ||
type: 'blue' | ||
}, | ||
{ | ||
id: 6, | ||
title: 'child 2-3', | ||
type: 'brown' | ||
} | ||
], | ||
}, | ||
{ | ||
id: 7, | ||
title: 'child 3', | ||
}, | ||
{ | ||
id: 8, | ||
title: 'child 4', | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
methods: { | ||
fnCustomClasses(node) { | ||
if (node.type !== undefined) { | ||
return ['twtree-node-' + node.type] | ||
} | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.panel .tree { | ||
width: 50%; | ||
} | ||
.panel .tree >>> .twtree-node-red { | ||
color: red; | ||
} | ||
.panel .tree >>> .twtree-node-blue { | ||
color: blue; | ||
} | ||
.panel .tree >>> .twtree-node-brown { | ||
color: brown; | ||
} | ||
</style> |
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
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