mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
657 B
657 B
Transparent
If you don't need wrapper DOM, set it to transparent.
<n-button @click="theme = 'dark'">Dark Theme</n-button>
<n-button @click="theme = 'light'">Light Theme</n-button>
<n-config-provider :theme="theme" :theme-environment="env" transparent>
<n-config-consumer>
<template v-slot="{ themeEnvironment }">
<div>No Wrapper DOM: {{ themeEnvironment }}</div>
</template>
</n-config-consumer>
</n-config-provider>
export default {
data () {
return {
theme: 'light',
env: {
dark: 'Dark 666',
light: 'Light 666'
}
}
}
}
.n-button {
margin: 0 8px 12px 0;
}