<!--
source: https://blueos.niceshare.site/component/common/common-attributes/
site: 蓝河文档馆
summary: 通用属性，即所有组件都支持的属性。
-->
---
title: '通用属性'
description: '通用属性，即所有组件都支持的属性。'
lastUpdated: 2023-10-31T09:06:23.000Z
---

通用属性，即所有组件都支持的属性。

开发者可以在所有的组件标签上都使用`通用属性`

## 示例代码

```html
<template>
  <div>
    <text id="text1" class="text-normal">line 1</text>
    <text id="text2" class="text-normal red">line 2</text>
  </div>
</template>
```

## 常规属性

| 名称 | 类型 | 默认值 | 描述 |
| --- | --- | --- | --- |
| id | `<string>` | \- | 唯一标识 |
| style | `<string>` | \- | 样式声明 |
| class | `<string>` | \- | 引用样式表 |
| disabled | `<boolean>` | false | 表明当前组件是否可用 |

## 渲染属性

| 名称 | 类型 | 默认值 | 描述 |
| --- | --- | --- | --- |
| for | `<array>` | \- | 根据数据列表，循环展开当前标签 |
| if | `<boolean>` | \- | 根据数据 boolean 值，添加或移除当前标签 |
| show | `<boolean>` | \- | 根据数据 boolean 值，显示或隐藏当前标签，相当于控制{ display: flex | none } |

渲染属性工作方式详见[ux 文件](/reference/configuration/ux-file)

注意：属性和样式不能混用，不能在属性字段中进行样式设置
