【发布时间】:2021-03-24 20:37:04
【问题描述】:
我在提交卡片时有一个表单我希望禁用提交按钮或需要为自适应卡片加载某种类型以避免继续提交表单 谁能帮帮我
卡片:
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.3",
"body": [{
"type": "TextBlock",
"text": "Hello !!",
"size": "Medium",
"weight": "Bolder"
},
{
"type": "Container",
"style": "accent",
"items": [{
"type": "TextBlock",
"text": "What was the type?"
},
{
"type": "Input.ChoiceSet",
"id": "call_type",
"style": "compact",
"isRequired": true,
"errorMessage": " required input",
"placeholder": "Please choose",
"choices": [{
"$data": "${Survey.questions[0].items}",
"title": "${choice}",
"value": "${value}"
}]
}
]
}
],
"actions": [{
"type": "Action.Submit",
"title": "Submit"
}]
}
和卡片渲染代码
var jsonTemplate = "some data",
var jsonDate = "some data"
var template = new ACData.Template(jsonTemplate);
var cardPayload = template.expand({
$root: jsonData
});
var adaptiveCard = new AdaptiveCards.AdaptiveCard();
adaptiveCard.onExecuteAction = function(action) {
alert("Ow!");
}
adaptiveCard.parse(cardPayload);
let renderedCard = adaptiveCard.render();
document.body.appendChild(renderedCard);
【问题讨论】:
-
正在使用 Angular 吗?
-
我正在使用 React,它是一个 Web 应用程序,因为我正在使用自适应卡片
-
哦,你应该在这里添加你的代码以便更好地理解
-
我已经编辑并添加了代码