Skip to content

Commit

Permalink
ci(language-service): update html data
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 16, 2024
1 parent 6bc8918 commit 62de689
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/language-service/data/template/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@
"name": "v-bind",
"description": {
"kind": "markdown",
"value": "\n动态的绑定一个或多个 attribute,也可以是组件的 prop。\n\n<!-- TODO: translation -->\n\n- **缩写:**\n - `:` 或者 `.` (当使用 `.prop` 修饰符)\n - Omitting value (when attribute and bound value has the same name) <sup class=\"vt-badge\">3.4+</sup>\n\n- **期望:**`any (带参数) | Object (不带参数)`\n\n- **参数:**`attrOrProp (可选的)`\n\n- **修饰符**\n\n - `.camel` - 将短横线命名的 attribute 转变为驼峰式命名。\n - `.prop` - 强制绑定为 DOM property。<sup class=\"vt-badge\">3.2+</sup>\n - `.attr` - 强制绑定为 DOM attribute。<sup class=\"vt-badge\">3.2+</sup>\n\n- **用途**\n\n 当用于绑定 `class` 或 `style` attribute,`v-bind` 支持额外的值类型如数组或对象。详见下方的指南链接。\n\n 在处理绑定时,Vue 默认会利用 `in` 操作符来检查该元素上是否定义了和绑定的 key 同名的 DOM property。如果存在同名的 property,则 Vue 会将它作为 DOM property 赋值,而不是作为 attribute 设置。这个行为在大多数情况都符合期望的绑定值类型,但是你也可以显式用 `.prop` 和 `.attr` 修饰符来强制绑定方式。有时这是必要的,特别是在和[自定义元素](https://cn.vuejs.org/guide/extras/web-components.html#passing-dom-properties)打交道时。\n\n 当用于组件 props 绑定时,所绑定的 props 必须在子组件中已被正确声明。\n\n 当不带参数使用时,可以用于绑定一个包含了多个 attribute 名称-绑定值对的对象。\n\n- **示例**\n\n ```html\n <!-- 绑定 attribute -->\n <img v-bind:src=\"imageSrc\" />\n\n <!-- 动态 attribute 名 -->\n <button v-bind:[key]=\"value\"></button>\n\n <!-- 缩写 -->\n <img :src=\"imageSrc\" />\n\n <!-- 缩写形式的动态 attribute 名 (3.4+),扩展为 :src=\"src\" -->\n <img :src />\n\n <!-- 动态 attribute 名的缩写 -->\n <button :[key]=\"value\"></button>\n\n <!-- 内联字符串拼接 -->\n <img :src=\"'/path/to/images/' + fileName\" />\n\n <!-- class 绑定 -->\n <div :class=\"{ red: isRed }\"></div>\n <div :class=\"[classA, classB]\"></div>\n <div :class=\"[classA, { classB: isB, classC: isC }]\"></div>\n\n <!-- style 绑定 -->\n <div :style=\"{ fontSize: size + 'px' }\"></div>\n <div :style=\"[styleObjectA, styleObjectB]\"></div>\n\n <!-- 绑定对象形式的 attribute -->\n <div v-bind=\"{ id: someProp, 'other-attr': otherProp }\"></div>\n\n <!-- prop 绑定。“prop” 必须在子组件中已声明。 -->\n <MyComponent :prop=\"someThing\" />\n\n <!-- 传递子父组件共有的 prop -->\n <MyComponent v-bind=\"$props\" />\n\n <!-- XLink -->\n <svg><a :xlink:special=\"foo\"></a></svg>\n ```\n\n `.prop` 修饰符也有专门的缩写,`.`:\n\n ```html\n <div :someProperty.prop=\"someObject\"></div>\n\n <!-- 等同于 -->\n <div .someProperty=\"someObject\"></div>\n ```\n\n 当在 DOM 内模板使用 `.camel` 修饰符,可以驼峰化 `v-bind` attribute 的名称,例如 SVG `viewBox` attribute:\n\n ```html\n <svg :view-box.camel=\"viewBox\"></svg>\n ```\n\n 如果使用字符串模板或使用构建步骤预编译模板,则不需要 `.camel`。\n\n- **参考**\n - [Class 与 Style 绑定](https://cn.vuejs.org/guide/essentials/class-and-style.html)\n - [组件 - Prop 传递细节](https://cn.vuejs.org/guide/components/props.html#prop-passing-details)\n"
"value": "\n动态的绑定一个或多个 attribute,也可以是组件的 prop。\n\n- **缩写:**\n - `:` 或者 `.` (当使用 `.prop` 修饰符)\n - 值可以省略 (当 attribute 和绑定的值同名时) <sup class=\"vt-badge\">3.4+</sup>\n\n- **期望:**`any (带参数) | Object (不带参数)`\n\n- **参数:**`attrOrProp (可选的)`\n\n- **修饰符**\n\n - `.camel` - 将短横线命名的 attribute 转变为驼峰式命名。\n - `.prop` - 强制绑定为 DOM property。<sup class=\"vt-badge\">3.2+</sup>\n - `.attr` - 强制绑定为 DOM attribute。<sup class=\"vt-badge\">3.2+</sup>\n\n- **用途**\n\n 当用于绑定 `class` 或 `style` attribute,`v-bind` 支持额外的值类型如数组或对象。详见下方的指南链接。\n\n 在处理绑定时,Vue 默认会利用 `in` 操作符来检查该元素上是否定义了和绑定的 key 同名的 DOM property。如果存在同名的 property,则 Vue 会将它作为 DOM property 赋值,而不是作为 attribute 设置。这个行为在大多数情况都符合期望的绑定值类型,但是你也可以显式用 `.prop` 和 `.attr` 修饰符来强制绑定方式。有时这是必要的,特别是在和[自定义元素](https://cn.vuejs.org/guide/extras/web-components.html#passing-dom-properties)打交道时。\n\n 当用于组件 props 绑定时,所绑定的 props 必须在子组件中已被正确声明。\n\n 当不带参数使用时,可以用于绑定一个包含了多个 attribute 名称-绑定值对的对象。\n\n- **示例**\n\n ```html\n <!-- 绑定 attribute -->\n <img v-bind:src=\"imageSrc\" />\n\n <!-- 动态 attribute 名 -->\n <button v-bind:[key]=\"value\"></button>\n\n <!-- 缩写 -->\n <img :src=\"imageSrc\" />\n\n <!-- 缩写形式的动态 attribute 名 (3.4+),扩展为 :src=\"src\" -->\n <img :src />\n\n <!-- 动态 attribute 名的缩写 -->\n <button :[key]=\"value\"></button>\n\n <!-- 内联字符串拼接 -->\n <img :src=\"'/path/to/images/' + fileName\" />\n\n <!-- class 绑定 -->\n <div :class=\"{ red: isRed }\"></div>\n <div :class=\"[classA, classB]\"></div>\n <div :class=\"[classA, { classB: isB, classC: isC }]\"></div>\n\n <!-- style 绑定 -->\n <div :style=\"{ fontSize: size + 'px' }\"></div>\n <div :style=\"[styleObjectA, styleObjectB]\"></div>\n\n <!-- 绑定对象形式的 attribute -->\n <div v-bind=\"{ id: someProp, 'other-attr': otherProp }\"></div>\n\n <!-- prop 绑定。“prop” 必须在子组件中已声明。 -->\n <MyComponent :prop=\"someThing\" />\n\n <!-- 传递子父组件共有的 prop -->\n <MyComponent v-bind=\"$props\" />\n\n <!-- XLink -->\n <svg><a :xlink:special=\"foo\"></a></svg>\n ```\n\n `.prop` 修饰符也有专门的缩写,`.`:\n\n ```html\n <div :someProperty.prop=\"someObject\"></div>\n\n <!-- 等同于 -->\n <div .someProperty=\"someObject\"></div>\n ```\n\n 当在 DOM 内模板使用 `.camel` 修饰符,可以驼峰化 `v-bind` attribute 的名称,例如 SVG `viewBox` attribute:\n\n ```html\n <svg :view-box.camel=\"viewBox\"></svg>\n ```\n\n 如果使用字符串模板或使用构建步骤预编译模板,则不需要 `.camel`。\n\n- **参考**\n - [Class 与 Style 绑定](https://cn.vuejs.org/guide/essentials/class-and-style.html)\n - [组件 - Prop 传递细节](https://cn.vuejs.org/guide/components/props.html#prop-passing-details)\n"
},
"references": [
{
Expand Down

0 comments on commit 62de689

Please sign in to comment.