提交 33c058e3 编写于 作者: J Jacob Schatz

Can show file as computed property.

上级 c087e439
......@@ -29,6 +29,12 @@ const RepoFile = {
},
},
computed: {
canShowFile() {
return !this.loading.tree || this.hasFiles;
},
},
methods: {
linkClicked(file) {
this.$emit('linkclicked', file);
......@@ -40,7 +46,7 @@ export default RepoFile;
</script>
<template>
<tr class="file" v-if="!loading.tree || hasFiles" :class="{'active': activeFile.url === file.url}">
<tr class="file" v-if="canShowFile" :class="{'active': activeFile.url === file.url}">
<td @click.prevent="linkClicked(file)">
<i class="fa file-icon" v-if="!file.loading" :class="file.icon" :style="{'margin-left': file.level * 10 + 'px'}"></i>
<i class="fa fa-spinner fa-spin" v-if="file.loading" :style="{'margin-left': file.level * 10 + 'px'}"></i>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册