v-for
.links: [
{ title: 'link #1', to: { name: 'AdmissionActList' } },
{ title: 'link #2', to: { name: 'ShiftsTask' } },
// ну и так далее
],
<ul class="list-unstyled components">
<b-nav-item
v-for="link in links"
:to="link.to"
@click.prevent="sidebarCollapse"
>{{ link.title }}</b-nav-item>
</ul>
function shortNumber(val) {
const numSymbol = [ '', 'K', 'M', 'B', 'T' ];
let symbolIndex = 0;
while (val >= 1000) {
val = Math.round(val / 1000);
symbolIndex++;
}
return val + numSymbol[symbolIndex];
}
shortNumber(96); // 96
shortNumber(22222); // 22K
shortNumber(4951476); // 5M
if (elem == "edit") { app.UserBook.fullView(elem);
fullView(elem) { const d = document; const i = elem; d.querySelector('#Edname').value = this.items[i].fname;
for (let i = 0; i < this.items.length; i++) {
this.items.edit.fname; // Uncaught TypeError: Cannot read property 'fname' of undefined
this.items.rubbish.fname; // Uncaught TypeError: Cannot read property 'fname' of undefined