Skip to content

Commit

Permalink
chore: recover tree base demo (#2451)
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn authored Aug 16, 2023
1 parent 9d3b0cc commit 13fb59b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 11 deletions.
50 changes: 42 additions & 8 deletions src/tree/_example/base.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,48 @@ import { Tree } from 'tdesign-react';
const items = [
{
label: '第一段',
children: [],
children: [
{
label: '第二段',
},
{
label: '第二段',
},
],
},
{
label: '第一段',
children: [
{
label: '第二段',
},
{
label: '第二段',
},
],
},
{
label: '第一段',
children: [
{
label: '第二段',
},
{
label: '第二段',
},
],
},
{
label: '第一段',
children: [
{
label: '第二段',
},
{
label: '第二段',
},
],
},
];

const render0perations = () => <div>111</div>;

export default () => (
<>
<Tree data={items} line icon activable expandAll expandParent operations={render0perations} />
</>
);
export default () => <Tree data={items} activable hover transition />;
4 changes: 2 additions & 2 deletions test/snap/__snapshots__/csr.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -281047,15 +281047,15 @@ exports[`csr snapshot test > csr test src/tree/_example/base.jsx 1`] = `
/>
<div>
<div
class="t-tree t-tree--transition"
class="t-tree t-tree--hoverable t-tree--transition"
>
Tree Empty Data
</div>
</div>
</body>,
"container": <div>
<div
class="t-tree t-tree--transition"
class="t-tree t-tree--hoverable t-tree--transition"
>
Tree Empty Data
</div>
Expand Down
2 changes: 1 addition & 1 deletion test/snap/__snapshots__/ssr.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ exports[`ssr snapshot test > ssr test src/transfer/_example/tree.jsx 1`] = `"<di

exports[`ssr snapshot test > ssr test src/tree/_example/activable.jsx 1`] = `"<div style=\\"gap:16px\\" class=\\"t-space t-space-vertical\\"><div class=\\"t-space-item\\"><form class=\\"t-form\\"><div class=\\"t-form__item\\"><div class=\\"t-form__label t-form__label--right\\" style=\\"width:120px\\"><label>节点可高亮</label></div><div class=\\"t-form__controls\\" style=\\"margin-left:120px\\"><div class=\\"t-form__controls-content\\"><button type=\\"button\\" role=\\"switch\\" class=\\"t-switch t-is-checked t-size-m\\"><span class=\\"t-switch__handle\\"></span><div class=\\"t-switch__content\\"></div></button></div></div></div><div class=\\"t-form__item\\"><div class=\\"t-form__label t-form__label--right\\" style=\\"width:120px\\"><label>节点可多选高亮</label></div><div class=\\"t-form__controls\\" style=\\"margin-left:120px\\"><div class=\\"t-form__controls-content\\"><button type=\\"button\\" role=\\"switch\\" class=\\"t-switch t-size-m\\"><span class=\\"t-switch__handle\\"></span><div class=\\"t-switch__content\\"></div></button></div></div></div><div class=\\"t-form__item\\"><div class=\\"t-form__label t-form__label--right\\" style=\\"width:120px\\"><label>整个节点可点击</label></div><div class=\\"t-form__controls\\" style=\\"margin-left:120px\\"><div class=\\"t-form__controls-content\\"><button type=\\"button\\" role=\\"switch\\" class=\\"t-switch t-size-m\\"><span class=\\"t-switch__handle\\"></span><div class=\\"t-switch__content\\"></div></button></div></div></div></form></div><div class=\\"t-space-item\\"><div class=\\"t-tree t-tree--hoverable t-tree--transition\\">Tree Empty Data</div></div></div>"`;

exports[`ssr snapshot test > ssr test src/tree/_example/base.jsx 1`] = `"<div class=\\"t-tree t-tree--transition\\">Tree Empty Data</div>"`;
exports[`ssr snapshot test > ssr test src/tree/_example/base.jsx 1`] = `"<div class=\\"t-tree t-tree--hoverable t-tree--transition\\">Tree Empty Data</div>"`;

exports[`ssr snapshot test > ssr test src/tree/_example/checkable.jsx 1`] = `"<div style=\\"gap:16px\\" class=\\"t-space t-space-vertical\\"><div class=\\"t-space-item\\"><form class=\\"t-form\\"><div class=\\"t-form__item\\"><div class=\\"t-form__label t-form__label--right\\" style=\\"width:100px\\"><label>可选</label></div><div class=\\"t-form__controls\\" style=\\"margin-left:100px\\"><div class=\\"t-form__controls-content\\"><button type=\\"button\\" role=\\"switch\\" class=\\"t-switch t-is-checked t-size-m\\"><span class=\\"t-switch__handle\\"></span><div class=\\"t-switch__content\\"></div></button></div></div></div><div class=\\"t-form__item\\"><div class=\\"t-form__label t-form__label--right\\" style=\\"width:100px\\"><label>严格模式</label></div><div class=\\"t-form__controls\\" style=\\"margin-left:100px\\"><div class=\\"t-form__controls-content\\"><button type=\\"button\\" role=\\"switch\\" class=\\"t-switch t-size-m\\"><span class=\\"t-switch__handle\\"></span><div class=\\"t-switch__content\\"></div></button></div></div></div><div class=\\"t-form__item t-form-item__valueMode\\"><div class=\\"t-form__label t-form__label--right\\" style=\\"width:100px\\"><label>选中值模式</label></div><div class=\\"t-form__controls\\" style=\\"margin-left:100px\\"><div class=\\"t-form__controls-content\\"><div class=\\"t-radio-group t-size-m t-radio-group__outline\\"><label tabindex=\\"0\\" class=\\"t-radio t-is-checked\\" checked=\\"\\"><input type=\\"radio\\" class=\\"t-radio__former\\" tabindex=\\"-1\\" data-value=\\"&#x27;onlyLeaf&#x27;\\" checked=\\"\\" value=\\"onlyLeaf\\"/><span class=\\"t-radio__input\\"></span><span class=\\"t-radio__label\\">onlyLeaf</span></label><label tabindex=\\"0\\" class=\\"t-radio\\"><input type=\\"radio\\" class=\\"t-radio__former\\" tabindex=\\"-1\\" data-value=\\"&#x27;parentFirst&#x27;\\" value=\\"parentFirst\\"/><span class=\\"t-radio__input\\"></span><span class=\\"t-radio__label\\">parentFirst</span></label><label tabindex=\\"0\\" class=\\"t-radio\\"><input type=\\"radio\\" class=\\"t-radio__former\\" tabindex=\\"-1\\" data-value=\\"&#x27;all&#x27;\\" value=\\"all\\"/><span class=\\"t-radio__input\\"></span><span class=\\"t-radio__label\\">all</span></label></div></div></div></div></form></div><div class=\\"t-space-item\\"><div class=\\"t-tree t-tree--hoverable t-tree--checkable t-tree--transition\\">Tree Empty Data</div></div></div>"`;

Expand Down

0 comments on commit 13fb59b

Please sign in to comment.