BigW Consortium Gitlab

moved key into data structure

uses an array of classes to render skeleton loading cells
parent e2bcb3a4
......@@ -39,7 +39,7 @@
return this.file.id.substr(0, 8);
},
submoduleColSpan() {
return !this.isCollapsed && this.isSubmodule ? 3 : undefined;
return !this.isCollapsed && this.isSubmodule ? 3 : 1;
},
},
methods: {
......
......@@ -80,7 +80,7 @@ export default {
/>
<repo-file
v-for="(file, index) in treeList"
:key="file.name + file.type"
:key="file.key"
:file="file"
/>
</tbody>
......
export const dataStructure = () => ({
id: '',
key: '',
type: '',
name: '',
url: '',
......@@ -55,6 +56,7 @@ export const decorateData = (entity) => {
return {
...dataStructure(),
id,
key: `${name}-${type}-${id}`,
type,
name,
url,
......
......@@ -12,6 +12,11 @@
default: 6,
},
},
computed: {
lineClasses() {
return new Array(this.lines).fill().map((_, i) => `skeleton-line-${i}`);
},
},
};
</script>
......@@ -23,9 +28,9 @@
}"
>
<div
v-for="line in lines"
:key="line"
:class="'skeleton-line-' + line"
v-for="(css, index) in lineClasses"
:key="index"
:class="css"
>
</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