naive-ui/demo/documentation/components/icon/zhCN/theme.demo.md
07akioni 487001d697 build: add changelog to site, refactor loader based on suffix
.demo.md for component demo
.demo-entry.md for demo entry
.md for common docs
2020-08-19 23:30:04 +08:00

461 B

适配主题

Naive UI 提供一些简单的方法来自定义不同主题下的样式。

<n-icon
  size="40"
  :themed-style="{
    dark: {
      fill: 'rgb(0, 128, 0)',
      stroke: 'rgb(0, 128, 0)'
    },
    light: {
      fill: 'rgb(0, 160, 0)',
      stroke: 'rgb(0, 160, 0)'
    }
  }"
>
  <cash-outline />
</n-icon>
import cashOutline from 'naive-ui/lib/icons/cash-outline'

export default {
  components: {
    cashOutline
  }
}