mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
487001d697
.demo.md for component demo .demo-entry.md for demo entry .md for common docs
759 B
759 B
Click on Item Header
<n-collapse
v-model="activeNames"
@item-header-click="handleItemHeaderClick"
>
<n-collapse-item name="1">
<template v-slot:header>
Bronze
</template>
<div>Okay</div>
</n-collapse-item>
<n-collapse-item name="2">
<template v-slot:header>
Silver
</template>
<div>Good</div>
</n-collapse-item>
<n-collapse-item name="3">
<template v-slot:header>
Gold
</template>
<div>Excellent</div>
</n-collapse-item>
</n-collapse>
export default {
data () {
return {
activeNames: []
}
},
methods: {
handleItemHeaderClick ({
name,
expanded
}) {
this.$NMessage.info(`Name: ${name}, Expanded: ${expanded}`)
}
}
}