Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync #ba5f0fb #450

Merged
merged 13 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"postinstall": "patch-package"
},
"dependencies": {
"@vue/repl": "^1.0.0",
"@vue/repl": "^1.2.4",
"@vue/theme": "1.0.2",
"dynamics.js": "^1.1.5",
"gsap": "^3.9.0",
"vitepress": "^0.22.4",
"vue": "^3.2.33"
"vue": "^3.2.37"
},
"devDependencies": {
"@milahu/patch-package": "^6.4.14",
Expand Down
161 changes: 73 additions & 88 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions src/guide/best-practices/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ watch(

#### `aria-label` {#aria-label}

你也可以为 input 框配置一个带有 [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) 的无障碍访问名。
你也可以为 input 框配置一个带有 [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) 的无障碍访问名。

```vue-html
<label for="name">Name</label>
Expand All @@ -210,7 +210,7 @@ watch(

#### `aria-labelledby` {#aria-labelledby}

使用 [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute) 类似于 `aria-label`,除非标签文本在屏幕上可见。它通过 `id` 与其他元素配对,你可以链接多个 `id`:
使用 [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby) 类似于 `aria-label`,除非标签文本在屏幕上可见。它通过 `id` 与其他元素配对,你可以链接多个 `id`:

```vue-html
<form
Expand Down Expand Up @@ -240,7 +240,7 @@ watch(

#### `aria-describedby` {#aria-describedby}

[aria-describedby](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute) 的用法与 `aria-labelledby` 相同,它提供了一条用户可能需要的附加描述信息。这可用于描述任何输入的标准:
[aria-describedby](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) 的用法与 `aria-labelledby` 相同,它提供了一条用户可能需要的附加描述信息。这可用于描述任何输入的标准:

```vue-html
<form
Expand Down Expand Up @@ -305,8 +305,7 @@ watch(

### 用法说明 {#instructions}

添加用法说明时,请确保将其正确链接到目标 input 框。你可以提供附加用法说明并在 [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute) 内绑定多个 id。这可以使设计更加灵活。

添加用法说明时,请确保将其正确链接到目标 input 框。你可以提供附加用法说明并在 [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby) 内绑定多个 id。这可以使设计更加灵活。

```vue-html
<fieldset>
Expand All @@ -322,7 +321,7 @@ watch(
</fieldset>
```

或者,你可以通过 [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute) 将用法说明附加到 input 框上。
或者,你可以通过 [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby) 将用法说明附加到 input 框上。

```vue-html
<fieldset>
Expand Down
2 changes: 1 addition & 1 deletion src/guide/built-ins/transition-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ import ListStagger from './transition-demos/ListStagger.vue'
</TransitionGroup>
```

接着,在 JavaScript 钩子中,我们基于这个 data attribute 对该元素执行一个延迟动画:
接着,在 JavaScript 钩子中,我们基于这个 data attribute 对该元素执行一个延迟动画。以下是一个基于 [GreenSock library](https://greensock.com/) 的动画示例

```js{5}
function onEnter(el, done) {
Expand Down
2 changes: 1 addition & 1 deletion src/guide/essentials/class-and-style.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Class 与 Style 绑定 {#class-and-style-bindings}

数据绑定的一个常见需求场景是操纵元素的 CSS class 列表和内联样式。因为它们都是 attribute,我们可以使用 `v-bind` 来做这件事:我们只需要通过表达式计算出一个字符串作为最终结果即可。然而频繁地连接字符串让人很闹心,也很容易出错。因此,Vue 专门为 `class` 和 `style` 的 `v-bind` 用法提供了特殊的功能增强。除了字符串外,表达式的结果还可以是对象或数组。
数据绑定的一个常见需求场景是操纵元素的 CSS class 列表和内联样式。因为 `class` 和 `style` 都是 attribute,我们可以和其他 attribute 一样使用 `v-bind` 把一个动态的字符串赋值给它们。然而通过字符串拼接生成这些值是麻烦且易出错的。因此,Vue 专门为 `class` 和 `style` 的 `v-bind` 用法提供了特殊的功能增强。除了字符串外,表达式的结果还可以是对象或数组。

## 绑定 HTML class {#binding-html-classes}

Expand Down
Loading