mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
634 B
634 B
Caveat About Theme
Wherever you use this.$NMessage
to generate a message, if you don't specify the theme of it, the theme of created message will follow the outer-most ascendant Config Provider of this
. Making the message's theme as same as its invoking component instance will cause chaos.
<n-button @click="emitInfo">
You can change the theme while the message is active
</n-button>
export default {
data() {
return {}
},
methods: {
emitInfo() {
this.$NMessage.info(
"I don't know why nobody told you how to unfold your love",
{ duration: 5000 }
)
}
}
}