Office.RibbonUpdaterData interface
指定对功能区的更改,例如按钮的启用或禁用状态。
注解
要求集: RibbonAPI 1.1
属性
tabs | 使用 调用设置其状态的选项卡的 |
属性详细信息
tabs
使用 调用设置其状态的选项卡的 requestUpdate
集合。
tabs: Tab[];
属性值
示例
// Office.Tab objects are properties of ribbon updater objects that are passed to the
// Office.ribbon.requestUpdate method. The following shows how to set the visibility of
// a custom contextual tab.
async function showDataTab() {
await Office.ribbon.requestUpdate({
tabs: [
{
id: "CtxTab1",
visible: true
}
]});
}
// The following does the same thing in TypeScript.
const showDataTab = async () => {
const myContextualTab: Office.Tab = { id: "CtxTab1", visible: true };
const ribbonUpdater: Office.RibbonUpdaterData = { tabs: [ myContextualTab ] };
await Office.ribbon.requestUpdate(ribbonUpdater);
}