-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(page-header): support rtl (#1154)
* feat:n-input Support hidden password * feat(form): support require-mark-placement(#171) * Revert "feat(form): support require-mark-placement(#171)" This reverts commit 0627777. * Revert "feat:n-input Support hidden password" This reverts commit ea64917. * feat(page-header): support rtl * add en demo * fix code * fix code * fix code
- Loading branch information
Showing
9 changed files
with
142 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
|
||
```demo | ||
basic | ||
rtl-debug | ||
``` | ||
|
||
## Props | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Rtl Debug | ||
|
||
```html | ||
<n-space vertical> | ||
<n-space><n-switch v-model:value="rtlEnabled" />Rtl</n-space> | ||
<n-config-provider :rtl="rtlEnabled ? rtlStyles : undefined"> | ||
<n-page-header subtitle="让你的听觉更懂视觉" @back="handleBack"> | ||
<n-grid :cols="5"> | ||
<n-gi> | ||
<n-statistic label="正片" value="125 集" /> | ||
</n-gi> | ||
<n-gi> | ||
<n-statistic label="嘉宾" value="22 位" /> | ||
</n-gi> | ||
<n-gi> | ||
<n-statistic label="道歉" value="36 次" /> | ||
</n-gi> | ||
<n-gi> | ||
<n-statistic label="话题" value="83 个" /> | ||
</n-gi> | ||
<n-gi> | ||
<n-statistic label="参考链接" value="2,346 个" /> | ||
</n-gi> | ||
</n-grid> | ||
<template #title> | ||
<a | ||
href="https://anyway.fm/" | ||
style="text-decoration: none; color: inherit;" | ||
>Anyway.FM</a | ||
> | ||
</template> | ||
<template #header> | ||
<n-breadcrumb> | ||
<n-breadcrumb-item>播客</n-breadcrumb-item> | ||
<n-breadcrumb-item>精选</n-breadcrumb-item> | ||
<n-breadcrumb-item>超级精选</n-breadcrumb-item> | ||
<n-breadcrumb-item>Anyway.FM</n-breadcrumb-item> | ||
</n-breadcrumb> | ||
</template> | ||
<template #avatar> | ||
<n-avatar | ||
src="https://cdnimg103.lizhi.fm/user/2017/02/04/2583325032200238082_160x160.jpg" | ||
/> | ||
</template> | ||
<template #extra> | ||
<n-space> | ||
<n-button>催更</n-button> | ||
<n-dropdown :options="options" placement="bottom-start"> | ||
<n-button :bordered="false" style="padding: 0 4px">···</n-button> | ||
</n-dropdown> | ||
</n-space> | ||
</template> | ||
<template #footer>截止到 2021 年 4 月 3 日</template> | ||
</n-page-header> | ||
</n-config-provider> | ||
</n-space> | ||
``` | ||
|
||
```js | ||
import { EllipsisHorizontal } from '@vicons/ionicons5' | ||
import { defineComponent, ref } from 'vue' | ||
import { unstablePageHeaderRtl, useMessage } from 'naive-ui' | ||
|
||
export default defineComponent({ | ||
components: { | ||
EllipsisHorizontal | ||
}, | ||
setup () { | ||
const message = useMessage() | ||
return { | ||
rtlEnabled: ref(false), | ||
rtlStyles: [unstablePageHeaderRtl], | ||
handleBack () { | ||
message.info('[onBack]') | ||
}, | ||
options: [ | ||
{ | ||
label: '催更', | ||
key: '1' | ||
}, | ||
{ | ||
label: '催更', | ||
key: '2' | ||
}, | ||
{ | ||
label: '催更', | ||
key: '3' | ||
} | ||
] | ||
} | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { c, cB, cM } from '../../../_utils/cssr' | ||
|
||
export default c([ | ||
cB('page-header-wrapper', [ | ||
cM('rtl', [ | ||
cB('page-header-header', ` | ||
direction: rtl; | ||
`), | ||
cB('page-header', ` | ||
direction: rtl; | ||
`), | ||
cB('page-header-content', ` | ||
direction: rtl; | ||
`), | ||
cB('page-header-footer', ` | ||
direction: rtl; | ||
`) | ||
]) | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { pageHeaderLight } from './light' | ||
export type { PageHeaderTheme, PageHeaderThemeVars } from './light' | ||
export { pageHeaderDark } from './dark' | ||
export { default as pageHeaderRtl } from './rtl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import rtlStyle from '../src/styles/page-header-rtl.cssr' | ||
|
||
export default { | ||
name: 'PageHeader', | ||
style: rtlStyle | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters