Commit 93d1895b authored by Clement Ho's avatar Clement Ho

Refactor v-if into computed

parent dd20613c
...@@ -4,10 +4,15 @@ export default { ...@@ -4,10 +4,15 @@ export default {
hiddenAssignees: { type: Number, required: true }, hiddenAssignees: { type: Number, required: true },
toggle: { type: Function, required: true } toggle: { type: Function, required: true }
}, },
computed: {
showMore() {
return this.hiddenAssignees > 0;
}
},
template: ` template: `
<div class="user-list-more"> <div class="user-list-more">
<button type="button" class="btn-link" @click="toggle"> <button type="button" class="btn-link" @click="toggle">
<template v-if="hiddenAssignees > 0"> <template v-if="showMore">
+ {{hiddenAssignees}} more + {{hiddenAssignees}} more
</template> </template>
<template v-else> <template v-else>
......
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