首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在docassemble中显示“退出”按钮和“继续”按钮。

在docassemble中显示“退出”按钮和“继续”按钮。
EN

Stack Overflow用户
提问于 2022-10-05 14:43:49
回答 1查看 54关注 0票数 0

我试图在每个问题上显示退出按钮,以及docassemble中的“继续”按钮。默认情况下,docassemble会生成“继续”按钮,但我也希望有“退出”按钮。我知道有一个问题不可能有多个指令,但我想知道是否有一个技巧可以这么做。我已经翻阅了文档,没有找到任何可以显示退出按钮的东西。

有可能吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-05 15:04:06

您可以使用action buttons,但是您需要将它添加到YAML中的每个question中。在面试中没有向每个屏幕添加额外按钮的功能。

代码语言:javascript
复制
code: |
  exit_button = [{'action': 'https://docassemble.org', 'label': 'Exit', 'icon': 'sign-out-alt', 'color': 'danger'}]
---
mandatory: True
question: |
  Do you like fruit?
yesno: likes_fruit
action buttons:
  code: exit_button
---
mandatory: True
question: |
  Do you like vegetables?
yesno: likes_vegetables
action buttons:
  code: exit_button
---
mandatory: True
question: |
  What is your favorite color?
fields:
  - Color: favorite_color
action buttons:
  code: exit_button
---
mandatory: True
question: Done
action buttons:
  code: exit_button

或者,您可以在静态文件夹中创建一个JavaScript文件,并将其包含在与features -> javascript的访谈中;在JavaScript文件中,您可以添加一个daPageLoad侦听器,该侦听器将一个按钮添加到按钮<div> (您可以在fieldset.da-button-set中找到该按钮)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73962155

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档