Office.RibbonUpdaterData interface
指定对功能区的更改,例如按钮的已启用或禁用状态。
属性
| 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);
}