docs(button): optimizate button rtl demo (#125)

This commit is contained in:
cyn 2021-06-15 12:16:06 +08:00 committed by GitHub
parent 0727cd9f74
commit 962c2cebbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,19 +5,36 @@
<n-space><n-switch v-model:value="rtlEnabled" />Rtl</n-space>
<n-config-provider :rtl="rtlEnabled ? rtlStyles : undefined">
<n-space>
<n-button>Rtl Test</n-button>
<n-button>Rtl Test</n-button>
<n-button>Rtl Test</n-button>
<n-button>
<template #icon>
<n-icon>
<cash-icon />
</n-icon>
</template>
Rtl Test
</n-button>
<n-button icon-placement="right">
<template #icon>
<n-icon>
<cash-icon />
</n-icon>
</template>
Rtl Test
</n-button>
</n-space>
</n-config-provider>
</n-space>
```
```js
import { CashOutline as CashIcon } from '@vicons/ionicons5'
import { defineComponent, ref } from 'vue'
import { unstableButtonRtl } from 'naive-ui'
export default defineComponent({
components: {
CashIcon
},
setup () {
return {
rtlEnabled: ref(false),