mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Review: add hasMore() computed value +
Replacing varying conditions for same logic with computed value `hasMore`.
This commit is contained in:
parent
b3f1137006
commit
e018e2ead9
@ -13,7 +13,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<base-button
|
<base-button
|
||||||
v-if="allConnectionsCount - connections.length"
|
v-if="hasMore"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
class="spacer-x-small"
|
class="spacer-x-small"
|
||||||
size="small"
|
size="small"
|
||||||
@ -26,7 +26,7 @@
|
|||||||
}}
|
}}
|
||||||
</base-button>
|
</base-button>
|
||||||
<ds-input
|
<ds-input
|
||||||
v-if="connections.length > 7"
|
v-if="!hasMore"
|
||||||
v-focus="true"
|
v-focus="true"
|
||||||
:name="`${type}Filter`"
|
:name="`${type}Filter`"
|
||||||
:placeholder="filter"
|
:placeholder="filter"
|
||||||
@ -70,9 +70,11 @@ export default {
|
|||||||
connections() {
|
connections() {
|
||||||
return this.user[this.type]
|
return this.user[this.type]
|
||||||
},
|
},
|
||||||
|
hasMore() {
|
||||||
|
return this.allConnectionsCount > this.connections.length
|
||||||
|
},
|
||||||
connectionsClass() {
|
connectionsClass() {
|
||||||
const overflow = this.connections.length > 7 ? ' --overflow' : ''
|
return `connections${this.hasMore ? '' : ' --overflow'}`
|
||||||
return `connections${overflow}`
|
|
||||||
},
|
},
|
||||||
filteredConnections() {
|
filteredConnections() {
|
||||||
if (!this.filter) {
|
if (!this.filter) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user