admin管理员组文章数量:1416651
I want to be able to hide/show the ponent in question, but from another ponent
Something like
-dropdown.Vue
<q-expansion-item
expand-separator
icon="perm_identity"
label="Account settings"
caption="John Doe"
>
<q-card>
<q-card-section>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem, eius reprehenderit eos corrupti
modi magni quaerat ex numquam, dolorum officiis modi facere maiores architecto suscipit iste
eveniet doloribus ullam aliquid.
</q-card-section>
</q-card>
</q-expansion-item>
closeDrop.Vue
<script>
methods: {
click() {
expansion-item.hide
}
}
</script>
Take in account that there is already @hide and @show methods in the ponent, but I weren't totally able to manage it from vuex!
I want to be able to hide/show the ponent in question, but from another ponent
Something like
-dropdown.Vue
<q-expansion-item
expand-separator
icon="perm_identity"
label="Account settings"
caption="John Doe"
>
<q-card>
<q-card-section>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem, eius reprehenderit eos corrupti
modi magni quaerat ex numquam, dolorum officiis modi facere maiores architecto suscipit iste
eveniet doloribus ullam aliquid.
</q-card-section>
</q-card>
</q-expansion-item>
closeDrop.Vue
<script>
methods: {
click() {
expansion-item.hide
}
}
</script>
Take in account that there is already @hide and @show methods in the ponent, but I weren't totally able to manage it from vuex!
Share Improve this question edited Nov 21, 2019 at 18:44 NataJdaCOliveira asked Jul 4, 2019 at 15:26 NataJdaCOliveiraNataJdaCOliveira 4311 gold badge6 silver badges18 bronze badges2 Answers
Reset to default 4Just set the v-model
as explained in https://quasar.dev/vue-ponents/expansion-item#Controlling-expansion-state:
<q-expansion-item
v-model="expanded"
icon="perm_identity"
label="Account settings"
caption="John Doe"
>
And in your script add an expanded
variable to your data:
export default {
data: () => ({
expanded: false
})
}
You can now toggle the expanded state by simply modifying the value of expanded
:
this.expanded = true
I made it using the ref attribute, and calling it with "this.$refs.expandableItem.hide()
本文标签:
版权声明:本文标题:javascript - How to "hideshow" the "Expandable Item" component (quasar) from another compone 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745253197a2649944.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论