Skip to content

Commit

Permalink
fix(teach): asset size without plugin-assets
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Apr 3, 2021
1 parent 4c84f33 commit a45811d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/plugin-teach/client/teach.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="card-grid profile-grid">
<k-numeric title="总问题数量" icon="quote-left">{{ meta.questions }}</k-numeric>
<k-numeric title="总问答数量" icon="quote-right">{{ meta.dialogues }}</k-numeric>
<k-numeric title="图片服务器" icon="hdd">{{ (meta.assetSize / 1048576).toFixed(1) }} MB</k-numeric>
<k-numeric title="图片服务器" icon="hdd">{{ assetSize }}</k-numeric>
</div>
<div class="card-grid chart-grid">
<word-cloud/>
Expand All @@ -12,8 +12,14 @@
<script lang="ts" setup>
import { meta } from '~/client'
import { computed } from 'vue'
import WordCloud from './word-cloud.vue'
const assetSize = computed(() => {
if (!meta.value.assetSize) return '暂无数据'
return (meta.value.assetSize / 1048576).toFixed(1) + ' MB'
})
</script>

<style lang="scss">
Expand Down

0 comments on commit a45811d

Please sign in to comment.