docs(collapse): fix translation Error (#12464)

This commit is contained in:
阿菜 Cai 2023-11-22 19:50:28 +08:00 committed by GitHub
parent eb8457e026
commit 941f92dbf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 23 deletions

View File

@ -25,9 +25,16 @@ Use `v-model` to control the name of active panels.
```html
<van-collapse v-model="activeNames">
<van-collapse-item title="Title1" name="1">Content 1</van-collapse-item>
<van-collapse-item title="Title2" name="2">Content 2</van-collapse-item>
<van-collapse-item title="Title3" name="3">Content 3</van-collapse-item>
<van-collapse-item title="Title1" name="1">
The code is written for people to see and can be run on a machine.
</van-collapse-item>
<van-collapse-item title="Title2" name="2">
Technology is nothing more than the common soul of those who develop it.
</van-collapse-item>
<van-collapse-item title="Title3" name="3">
The frequency of people swearing during code reading is the only measure of
code quality.
</van-collapse-item>
</van-collapse>
```
@ -48,9 +55,16 @@ In accordion mode, only one panel can be expanded at the same time.
```html
<van-collapse v-model="activeName" accordion>
<van-collapse-item title="Title1" name="1">Content 1</van-collapse-item>
<van-collapse-item title="Title2" name="2">Content 2</van-collapse-item>
<van-collapse-item title="Title3" name="3">Content 3</van-collapse-item>
<van-collapse-item title="Title1" name="1">
The code is written for people to see and can be run on a machine.
</van-collapse-item>
<van-collapse-item title="Title2" name="2">
Technology is nothing more than the common soul of those who develop it.
</van-collapse-item>
<van-collapse-item title="Title3" name="3">
The frequency of people swearing during code reading is the only measure of
code quality.
</van-collapse-item>
</van-collapse>
```
@ -71,28 +85,33 @@ Use the `disabled` prop to disable CollapseItem.
```html
<van-collapse v-model="activeNames">
<van-collapse-item title="Title1" name="1">Content 1</van-collapse-item>
<van-collapse-item title="Title1" name="1">
The code is written for people to see and can be run on a machine.
</van-collapse-item>
<van-collapse-item title="Title2" name="2" disabled>
Content 2
Technology is nothing more than the common soul of those who develop it.
</van-collapse-item>
<van-collapse-item title="Title3" name="3" disabled>
Content 3
The frequency of people swearing during code reading is the only measure of
code quality.
</van-collapse-item>
</van-collapse>
```
### Custom title
Using `title` slot to custom title.
```html
<van-collapse v-model="activeNames">
<van-collapse-item name="1">
<template #title>
<div>Title1 <van-icon name="question-o" /></div>
</template>
Content 1
The code is written for people to see and can be run on a machine.
</van-collapse-item>
<van-collapse-item title="Title2" name="2" icon="shop-o">
Content 2
Technology is nothing more than the common soul of those who develop it.
</van-collapse-item>
</van-collapse>
```
@ -114,9 +133,16 @@ Using `toggleAll` method to toggle all items.
```html
<van-collapse v-model="activeNames" ref="collapse">
<van-collapse-item title="Title1" name="1">Content 1</van-collapse-item>
<van-collapse-item title="Title2" name="2">Content 2</van-collapse-item>
<van-collapse-item title="Title3" name="3">Content 3</van-collapse-item>
<van-collapse-item title="Title1" name="1">
The code is written for people to see and can be run on a machine.
</van-collapse-item>
<van-collapse-item title="Title2" name="2">
Technology is nothing more than the common soul of those who develop it.
</van-collapse-item>
<van-collapse-item title="Title3" name="3">
The frequency of people swearing during code reading is the only measure of
code quality.
</van-collapse-item>
</van-collapse>
<van-button type="primary" @click="openAll">Open All</van-button>

View File

@ -19,9 +19,11 @@ const t = useTranslate({
inverse: '全部切换',
},
'en-US': {
text1: 'Content 1',
text2: 'Content 2',
text3: 'Content 3',
text1: 'The code is written for people to see and can be run on a machine.',
text2:
'Technology is nothing more than the common soul of those who develop it.',
text3:
'The frequency of people swearing during code reading is the only measure of code quality.',
accordion: 'Accordion',
titleSlot: 'Custom title',
toggleAll: 'Toggle All',

View File

@ -31,7 +31,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-collapse-item__wrapper">
<div class="van-collapse-item__content">
<!--[-->
Content 1
The code is written for people to see and can be run on a machine.
</div>
</div>
</div>
@ -112,7 +112,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-collapse-item__wrapper">
<div class="van-collapse-item__content">
<!--[-->
Content 1
The code is written for people to see and can be run on a machine.
</div>
</div>
</div>
@ -334,7 +334,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-collapse-item__wrapper">
<div class="van-collapse-item__content">
<!--[-->
Content 1
The code is written for people to see and can be run on a machine.
</div>
</div>
</div>

View File

@ -20,7 +20,7 @@ exports[`should render demo and match snapshot 1`] = `
</div>
<div class="van-collapse-item__wrapper">
<div class="van-collapse-item__content">
Content 1
The code is written for people to see and can be run on a machine.
</div>
</div>
</div>
@ -77,7 +77,7 @@ exports[`should render demo and match snapshot 1`] = `
</div>
<div class="van-collapse-item__wrapper">
<div class="van-collapse-item__content">
Content 1
The code is written for people to see and can be run on a machine.
</div>
</div>
</div>
@ -227,7 +227,7 @@ exports[`should render demo and match snapshot 1`] = `
</div>
<div class="van-collapse-item__wrapper">
<div class="van-collapse-item__content">
Content 1
The code is written for people to see and can be run on a machine.
</div>
</div>
</div>