第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何將“AdaptiveActionSet”放入“AdaptiveColumn”中?

如何將“AdaptiveActionSet”放入“AdaptiveColumn”中?

C#
犯罪嫌疑人X 2023-07-09 17:39:27
我想將“AdaptiveOpenUrlAction”放入“AdaptiveColumnSet”中,以獲得更好的自適應卡布局。但是,我的機器人模擬器不顯示 OpenUrl 按鈕。如何添加操作按鈕?也許這是adaptivecards版本的問題?我的adaptivecards的版本是1.1(1.0也可用)。我想請教解決辦法。下面是我編寫的代碼和我在模擬器中創(chuàng)建的 json 日志。ActionSet中的Json Log寫入到模擬器中,但是ActionSet中的按鈕并沒有顯示在卡片上。C# 代碼new AdaptiveColumn(){    Items =    {        new AdaptiveActionSet()        {            Actions =            {                new AdaptiveOpenUrlAction()                {                    Url = new Uri("https://www.someurl.com"),                    Title = "Reserve",                    Style = "positive",                }            }        }    },    Width = "auto",}日志記錄"items": [  {    "actions": [      {        "style": "positive",        "title": "Reserve",        "type": "Action.OpenUrl",        "url": "https://www.someurl.com"      }    ],    "type": "ActionSet"  }],"type": "Column","width": "auto"下面是我從“ https://adaptivecards.io/designer/ ”創(chuàng)建的自適應卡的布局。
查看完整描述

1 回答

?
守著星空守著你

TA貢獻1799條經(jīng)驗 獲得超8個贊

您可以在架構(gòu)中看到自適應卡 1.2 中引入了操作集:

http://img2.sycdn.imooc.com/64aa80870001b85402690162.jpg

目前支持 Adaptive Cards 1.2 的唯一官方聊天客戶端是 Web Chat,但 Web Chat 使用 Direct Line 通道,并且 Direct Line 會剔除它無法識別的元素:

在該 GitHub 問題中,您將找到一種解決方法,可以使用自定義內(nèi)容類型而不是application/vnd.microsoft.card.adaptive.?application/vnd.microsoft.card.custom例如,如果您將內(nèi)容類型設置為,則可以在網(wǎng)絡聊天的附件中間件中將附件轉(zhuǎn)換回自適應卡:

const attachmentMiddleware = () => next => card => {

? if (card.attachment.contentType === 'application/vnd.microsoft.card.custom'){

? ? card.attachment.contentType = 'application/vnd.microsoft.card.adaptive'

? }

? return next(card)

};


window.WebChat.renderWebChat({

? directLine,

? attachmentMiddleware

}, document.getElementById('webchat'));

使用該問題中描述的解決方法,我能夠成功呈現(xiàn)您的列集:

http://img2.sycdn.imooc.com/64aa809a0001435306480183.jpg

查看完整回答
反對 回復 2023-07-09
  • 1 回答
  • 0 關注
  • 125 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號