---
title: "props"

doc_type: static
doc_category: static
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/sline/object/props'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/sline/object/props.md'
---

# props


    你可以使用该对象获取调用模板时传入的自定义参数，仅在 [block](https://developer.shopline.com/zh-hans-cn/docs/sline/tag/block.md) 和 [component](https://developer.shopline.com/zh-hans-cn/docs/sline/tag/component.md) 渲染时可用。

    **Block示例：**

假设渲染 block 时传入如下参数：
```text
{{#block foo="bar" count=1 /}}
```

可以在 block 中通过如下方式获取参数：
```text
{{ props.foo }} {{ props.count }}
```

**Component示例：**

假设渲染 component 时传入如下参数：
```text
{{#component "demo" foo="bar" count=1 /}}
```

可以在 component 中通过如下方式获取参数：
```text
{{ props.foo }} {{ props.count }}
```





