Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
chimera-documentation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李昊晨
chimera-documentation
Commits
e548ccd2
Commit
e548ccd2
authored
Jan 08, 2020
by
李昊晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
📝
修改showmodal默认颜色,增加组件递归文档
parent
f1a978d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
2 deletions
+97
-2
config.js
docs/.vuepress/config.js
+6
-0
qa.showModal.md
docs/api/ui/interaction/qa.showModal.md
+2
-2
recursive-component.md
docs/framework/custom-component/recursive-component.md
+89
-0
No files found.
docs/.vuepress/config.js
View file @
e548ccd2
...
...
@@ -3082,6 +3082,12 @@ module.exports = {
path
:
'
/framework/custom-component/observer.md
'
,
collapsable
:
true
,
sidebarDepth
:
1
},
{
title
:
'
递归组件
'
,
path
:
'
/framework/custom-component/recursive-component.md
'
,
collapsable
:
true
,
sidebarDepth
:
1
}
]
},
...
...
docs/api/ui/interaction/qa.showModal.md
View file @
e548ccd2
...
...
@@ -12,9 +12,9 @@
| content | string | | 是 | 提示的内容 |
| showCancel | boolean | true | 否 | 是否显示取消按钮 |
| cancelText | string | '取消' | 否 | 取消按钮的文字,最多 4 个字符 |
| cancelColor | string | #00
0000
| 否 | 取消按钮的文字颜色 |
| cancelColor | string | #00
86FF
| 否 | 取消按钮的文字颜色 |
| confirmText | string | '确定' | 否 | 确认按钮的文字,最多 4 个字符 |
| confirmColor | string | #
576B95
| 否 | 确认按钮的文字颜色 |
| confirmColor | string | #
FFFFFF
| 否 | 确认按钮的文字颜色 |
| success | function | | 否 | 接口调用成功的回调函数 |
| fail | function | | 否 | 接口调用失败的回调函数 |
| complete | function | | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
...
...
docs/framework/custom-component/recursive-component.md
0 → 100644
View file @
e548ccd2
# 递归组件
自定义组件只需要简单配置即可递归使用。
在自定义组件的
`.json`
配置文件中,添加
`name`
字段,并指定名称,则可以在自定义组件中使用此字段的值作为组件名。如:
_my-layer.json_
```
json{2}
{
"name": "my-layer",
"component": true
}
```
_my-layer.js_
```
js
Component
({
properties
:
{
depth
:
{
type
:
Number
,
value
:
1
}
}
})
```
_my-layer.qxml_
```
xml
<view
class=
'my-layer'
>
this is layer {{ depth }}
<my-layer
qa:if=
'{{ depth > 1 }}'
depth=
'{{ depth - 1 }}'
></my-layer>
</view>
```
## 全局组件
`app.json`
中配置配置的组件,也可以作为递归组件使用。如:
_app.json_
```
json
{
"usingComponents"
:
{
"global-layer"
:
"./components/global-layer/global-layer"
}
}
```
_global-layer.js_
```
js
Component
({
properties
:
{
depth
:
{
type
:
Number
,
value
:
1
}
}
})
```
_global-layer.qxml_
```
xml
<view
class=
'global-layer'
>
this is layer {{ depth }}
<global-layer
qa:if=
'{{ depth > 1 }}'
depth=
'{{ depth - 1 }}'
></global-layer>
</view>
```
以上是两种组件的使用使用如:
_page.qxml_
```
xml
<view>
<my-layer
depth=
'{{ 3 }}'
></my-layer>
<global-layer
depth=
'{{ 3 }}'
></global-layer>
</view>
```
::: warning 注意
使用递归组件时,需要注意使用条件控制递归,否则可能会出现无限循环,出现 “max stack size exceeded” 的错误。
:::
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment