Skip to content

Commit

Permalink
add style binding md
Browse files Browse the repository at this point in the history
  • Loading branch information
Xicheng Guo committed Jul 18, 2024
1 parent 38f2aae commit f40b00c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/.vitepress/sidebars/vue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
link: /frontend/vue/template-syntax/attribute-binding#绑定布尔值属性
- text: 绑定对象属性
link: /frontend/vue/template-syntax/attribute-binding#绑定对象属性
- text: 样式绑定
link: /frontend/vue/template-syntax/style-binding
items:
- text: class 类样式绑定
link: /frontend/vue/template-syntax/style-binding#class-类样式绑定
- text: style 内联样式绑定
link: /frontend/vue/template-syntax/style-binding#style-内联样式绑定
# - text: 核心概念
# items:
# - text: 模版语法
Expand Down
27 changes: 27 additions & 0 deletions src/frontend/vue/template-syntax/style-binding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 样式绑定

Vue 专门为 v-bind 的用法绑定 class 和 style 提供了特殊的功能增强,表达式的值支持字符串、对象和数组。

## class 类样式绑定

`:class``v-bind:class` 的缩写)

### 绑定对象

<<< @/../projects/vue-sandbox/src/components/TemplateSyntax/ClassBindObj.vue

### 绑定数组

<<< @/../projects/vue-sandbox/src/components/TemplateSyntax/ClassBindArr.vue

## style 内联样式绑定

`:style``v-bind:style` 的缩写)

### 绑定对象

<<< @/../projects/vue-sandbox/src/components/TemplateSyntax/StyleBindObj.vue

### 绑定数组

<<< @/../projects/vue-sandbox/src/components/TemplateSyntax/StyleBindArr.vue

0 comments on commit f40b00c

Please sign in to comment.