Skip to content

Commit

Permalink
Perf: 优化细节
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Sep 17, 2023
1 parent 140cc4a commit 62d8a04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
5 changes: 4 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<el-table
:data="$fullRouter.options.routes"
:show-header="false"
row-class-name="row-pointer"
:row-class-name="tableRowClassName"
style="width: 100%"
@row-click="jump"
>
Expand Down Expand Up @@ -95,6 +95,9 @@ export default {
this.$router.push(row)
this.drawer = false
},
tableRowClassName ({ row }) {
return row.name === this.$route.name ? 'row-pointer current-row' : 'row-pointer'
},
},
}
</script>
Expand Down
11 changes: 2 additions & 9 deletions src/views/fullscreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
:teleport="teleport"
@change="handleFullscreenChange"
/>
<el-image
class="fullscreen-image"
:src="imageUrl"
/>
<el-image v-show="!isFullscreen" class="fullscreen-image" src="//picsum.photos/640/360?random=1" />
<el-image v-show="isFullscreen" class="fullscreen-image" src="//picsum.photos/1280/720?random=1" />
</div>
</div>
</div>
Expand All @@ -45,11 +43,6 @@ export default {
teleport: false,
}
},
computed: {
imageUrl() {
return this.isFullscreen ? '//picsum.photos/1280/720?random=1' : '//picsum.photos/640/360?random=1'
},
},
methods: {
handleFullscreenChange(isFullscreen) {
this.isFullscreen = isFullscreen
Expand Down

0 comments on commit 62d8a04

Please sign in to comment.