Commit eacd821a authored by Phil Hughes's avatar Phil Hughes

moved key into data structure

uses an array of classes to render skeleton loading cells
parent e2bcb3a4
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
return this.file.id.substr(0, 8); return this.file.id.substr(0, 8);
}, },
submoduleColSpan() { submoduleColSpan() {
return !this.isCollapsed && this.isSubmodule ? 3 : undefined; return !this.isCollapsed && this.isSubmodule ? 3 : 1;
}, },
}, },
methods: { methods: {
......
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
/> />
<repo-file <repo-file
v-for="(file, index) in treeList" v-for="(file, index) in treeList"
:key="file.name + file.type" :key="file.key"
:file="file" :file="file"
/> />
</tbody> </tbody>
......
export const dataStructure = () => ({ export const dataStructure = () => ({
id: '', id: '',
key: '',
type: '', type: '',
name: '', name: '',
url: '', url: '',
...@@ -55,6 +56,7 @@ export const decorateData = (entity) => { ...@@ -55,6 +56,7 @@ export const decorateData = (entity) => {
return { return {
...dataStructure(), ...dataStructure(),
id, id,
key: `${name}-${type}-${id}`,
type, type,
name, name,
url, url,
......
...@@ -12,6 +12,11 @@ ...@@ -12,6 +12,11 @@
default: 6, default: 6,
}, },
}, },
computed: {
lineClasses() {
return new Array(this.lines).fill().map((_, i) => `skeleton-line-${i}`);
},
},
}; };
</script> </script>
...@@ -23,9 +28,9 @@ ...@@ -23,9 +28,9 @@
}" }"
> >
<div <div
v-for="line in lines" v-for="(css, index) in lineClasses"
:key="line" :key="index"
:class="'skeleton-line-' + line" :class="css"
> >
</div> </div>
</div> </div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment