> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kasoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# arc:exists

> 检查指定对象中的属性是否有值，仅当属性存在且非空时执行正文块。

export const siteNameShort = "知行之桥";

arc:exists 关键字可以检查指定对象中的属性是否有值。[arc:notnull](./op-arc-not-null) 关键字与 arc:exists 是同义的。

## 参数

* **item**：要检查的对象。如果未指定，则使用默认的输出对象。
* **attr**：要检查的属性名称。
* **action**：如果表达式执行结果为 true 要执行的操作。允许的值有：break，continue。

## 控制属性

无

## 示例

为文件的对象集定义缺少的 title 属性：

```xml theme={null}
<arc:call op="fileListDir" output="out">
  <arc:exists attr="filename">
    <arc:set attr="title" value="[filename]"/>
    <arc:else>
      <arc:set attr="title" value="Unnamed File"/>
    </arc:else>
  </arc:exists>
  <arc:push title="[title]">
  [out.file:*] 
  </arc:push>
</arc:call> 
```

## 另请参阅

* [arc:else](./op-arc-else)：创建一个不满足条件时执行的代码块。
