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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ yarn-error.log*
*.sln
*.sw*
/package-lock.json
bun.lockb
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default {
landscape: [],
data: {
name: 'root',
image_url: "https://static.refined-x.com/static/avatar.jpg",
image_url: null,
class: ["rootNode"],
children: [
{
Expand Down
8 changes: 5 additions & 3 deletions src/components/TreeChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
@click="$emit('click-node', treeData)"
>
<div class="avat">
<img :src="treeData.image_url" />
<img v-if="treeData.image_url" :src="treeData.image_url" />
<h1 v-else>{{ treeData.name[0].toUpperCase() }}</h1>
</div>
<div class="name">{{treeData.name}}</div>
</div>
Expand All @@ -20,7 +21,8 @@
@click="$emit('click-node', mate)"
>
<div class="avat">
<img :src="mate.image_url" />
<img v-if="mate.image_url" :src="mate.image_url" />
<h1 v-else>{{ mate.name[0].toUpperCase() }}</h1>
</div>
<div class="name">{{mate.name}}</div>
</div>
Expand Down Expand Up @@ -94,7 +96,7 @@ transform: rotateZ(135deg);transform-origin: 50% 50% 0;transition: transform eas

.node{position: relative; display: inline-block;margin: 0 1em;box-sizing: border-box; text-align: center;}
.node .person{position: relative; display: inline-block;z-index: 2;width:6em; overflow: hidden;}
.node .person .avat{display: block;width:4em;height: 4em;margin:auto;overflow:hidden; background:#fff;border:1px solid #ccc;box-sizing: border-box;}
.node .person .avat{display: flex;justify-content: center;align-items: center;width:4em;height: 4em;margin:auto;overflow:hidden; background:#fff;border:1px solid #ccc;box-sizing: border-box;}
.node .person .avat img{width:100%;height: 100%;}
.node .person .name{height:2em;line-height: 2em;overflow: hidden;width:100%;}
.node.hasMate::after{content: "";position: absolute;left:2em;right:2em;top:2em;border-top:2px solid #ccc;z-index: 1;}
Expand Down