File tree Expand file tree Collapse file tree 2 files changed +63
-0
lines changed Expand file tree Collapse file tree 2 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,36 @@ A function to generate CSS from a template literal with interpolations.
105105</template>
106106```
107107
108+ ## ` cssClass `
109+
110+ A function generating css and return a class name.
111+
112+ ** Augments**
113+
114+ - CSS,` TemplateStringsArray ` ,` 必需 `
115+
116+ ** Return**
117+
118+ - Class name,` string `
119+
120+ ** Usage**
121+
122+ ``` vue
123+ <script setup lang="ts">
124+ import { cssClass } from '@vvibe/vue-styled-components'
125+
126+ const commonClass = cssClass`
127+ padding: 20px;
128+ color: #fff;
129+ background-color: red;
130+ `
131+ </script>
132+
133+ <template>
134+ <div :class="commonClass">Test</div>
135+ </template>
136+ ```
137+
108138## ` withAttrs `
109139
110140A function to add attributes to a ` ComponentInstance ` or ` HTMLElements ` .
Original file line number Diff line number Diff line change @@ -105,6 +105,39 @@ outline: deep
105105</template>
106106```
107107
108+
109+
110+ ## ` cssClass `
111+
112+ 一个使用模板字符串生成 CSS 并返回 class 类名的函数。
113+
114+ ** 参数**
115+
116+ - 模板字符串,` TemplateStringsArray ` ,` 必需 `
117+
118+ ** 返回值**
119+
120+ - class 名称,` string `
121+
122+ ** 用法**
123+
124+ ``` vue
125+
126+ <script setup lang="ts">
127+ import { cssClass } from '@vvibe/vue-styled-components'
128+
129+ const commonClass = cssClass`
130+ padding: 20px;
131+ color: #fff;
132+ background-color: red;
133+ `
134+ </script>
135+
136+ <template>
137+ <div :class="commonClass">Test</div>
138+ </template>
139+ ```
140+
108141## ` withAttrs `
109142
110143一个用于向 ` ComponentInstance ` 或 ` HTMLElements ` 添加 ` attributes ` 的函数。
You can’t perform that action at this time.
0 commit comments