Show or hide components

更新时间:
复制 MD 格式

Configure the Visible parameter to show or hide specified components. This topic describes how to show or hide a component by using the More Menus button as an example.

  • Demonstration

    • Hide the component隐藏

    • Show the component显示

  • Syntax

    expression.CommandBars(CommandBarId).Visible

    expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the More Menu button for page customization.
      const moreMenus = await app.CommandBars('MoreMenus');
    
      // Hide the More Menu button.
      moreMenus.Visible = false;
    
      // Obtain the status of the More Menu button.
      const visible = await moreMenus.Visible;
      console.log(visible);
    }