mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-24 12:45:18 +08:00
698 B
698 B
Use Naive Element
Naive UI has n-element
component. See Element.
<n-space vertical>
<n-space>
<n-button @click="theme = darkTheme">Dark</n-button>
<n-button @click="theme = null">Light</n-button>
</n-space>
<n-config-provider :theme="theme">
<n-card>
<n-el
tag="span"
style="color: var(--primary-color); transition: .3s var(--cubic-bezier-ease-in-out);"
>
I am a Span.
</n-el>
</n-card>
</n-config-provider>
</n-space>
import { ref } from 'vue'
import { darkTheme } from 'naive-ui'
export default {
setup () {
return {
darkTheme,
theme: ref(null)
}
}
}