这是我正在使用的代码片段:
app.askWithCarousel('Which of these looks good?',
app.buildCarousel()
.addItems([
app.buildOptionItem("SELECTION_KEY_ONE",
['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2'])
.setTitle('Number one'),
app.buildOptionItem("SELECTION_KEY_TWO",
['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2'])
.setTitle('Number two'),
]));
这是截图:
答案 0 :(得分:1)
我找到了解决方案。这可能是谷歌的一个bug。您所要做的就是添加.setDescription
方法
app.askWithCarousel('Which of these looks good?',
app.buildCarousel()
.addItems(
app.buildOptionItem("SELECTION_KEY_ONE",
['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2'])
.setTitle('Number one')
.setDescription('Number one description')
)
.addItems(
app.buildOptionItem("SELECTION_KEY_TWO",
['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2'])
.setTitle('Number two')
.setDescription('Number two description')
)
);
<强>更新强>
我刚刚发现,不可能设置像.setDescription('')
这样的空字符串。它返回一个错误。所以,我相处空间.setDescription(' ')