Compare commits

..

No commits in common. "137be6d79e9ddee450db771aa57c20dec85a01f7" and "881f742818f677e1a2d282ddcb2a28e798e4c161" have entirely different histories.

5 changed files with 3 additions and 109 deletions

View File

@ -166,8 +166,6 @@ export function getViteConfigForSiteProd(): InlineConfig {
outDir,
brotliSize: false,
emptyOutDir: true,
// https://github.com/youzan/vant/issues/9703
cssTarget: ['chrome53'],
rollupOptions: {
input: {
main: join(SITE_SRC_DIR, 'index.html'),

View File

@ -20,34 +20,6 @@ app.use(NavBar);
### Basic Usage
```html
<van-nav-bar title="Title" />
```
### Back
```html
<van-nav-bar
title="Title"
left-text="Back"
left-arrow
@click-left="onClickLeft"
/>
```
```js
export default {
setup() {
const onClickLeft = () => history.back();
return {
onClickLeft,
};
},
};
```
### Right Button
```html
<van-nav-bar
title="Title"
@ -64,7 +36,7 @@ import { Toast } from 'vant';
export default {
setup() {
const onClickLeft = () => history.back();
const onClickLeft = () => Toast('Back');
const onClickRight = () => Toast('Button');
return {
onClickLeft,

View File

@ -20,40 +20,6 @@ app.use(NavBar);
### 基础用法
通过 `title` 属性设置导航栏标题。
```html
<van-nav-bar title="标题" />
```
### 返回上级
在导航栏实现返回上级功能。
```html
<van-nav-bar
title="标题"
left-text="返回"
left-arrow
@click-left="onClickLeft"
/>
```
```js
export default {
setup() {
const onClickLeft = () => history.back();
return {
onClickLeft,
};
},
};
```
### 右侧按钮
在导航栏右侧添加可点击的按钮。
```html
<van-nav-bar
title="标题"
@ -70,7 +36,7 @@ import { Toast } from 'vant';
export default {
setup() {
const onClickLeft = () => history.back();
const onClickLeft = () => Toast('返回');
const onClickRight = () => Toast('按钮');
return {
onClickLeft,
@ -82,7 +48,7 @@ export default {
### 使用插槽
可以通过插槽自定义导航栏两侧的内容。
通过插槽自定义导航栏两侧的内容。
```html
<van-nav-bar title="标题" left-text="返回" left-arrow>

View File

@ -7,13 +7,9 @@ import { Toast } from '../../toast';
const t = useTranslate({
'zh-CN': {
useSlot: '使用插槽',
showBack: '返回上级',
rightButton: '右侧按钮',
},
'en-US': {
useSlot: 'Use Slot',
showBack: 'Back',
rightButton: 'Right Button',
},
});
@ -23,19 +19,6 @@ const onClickRight = () => Toast(t('button'));
<template>
<demo-block :title="t('basicUsage')">
<van-nav-bar :title="t('title')" />
</demo-block>
<demo-block :title="t('showBack')">
<van-nav-bar
:title="t('title')"
:left-text="t('back')"
left-arrow
@click-right="onClickRight"
/>
</demo-block>
<demo-block :title="t('rightButton')">
<van-nav-bar
:title="t('title')"
:left-text="t('back')"

View File

@ -1,31 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render demo and match snapshot 1`] = `
<div>
<div class="van-nav-bar van-hairline--bottom">
<div class="van-nav-bar__content">
<div class="van-nav-bar__title van-ellipsis">
Title
</div>
</div>
</div>
</div>
<div>
<div class="van-nav-bar van-hairline--bottom">
<div class="van-nav-bar__content">
<div class="van-nav-bar__left">
<i class="van-badge__wrapper van-icon van-icon-arrow-left van-nav-bar__arrow">
</i>
<span class="van-nav-bar__text">
Back
</span>
</div>
<div class="van-nav-bar__title van-ellipsis">
Title
</div>
</div>
</div>
</div>
<div>
<div class="van-nav-bar van-hairline--bottom">
<div class="van-nav-bar__content">