Loading...
Loading...
Compare original and translation side by side
allowDragAndDropdragAreaonDragStartdraggingdraggedallowDragAndDropdragAreaonDragStartdraggingdraggedlocalescrollSteplocalescrollStepenablePersistenceenablePersistenceimport { Component } from '@angular/core';
import { TabModule } from '@syncfusion/ej2-angular-navigations';
@Component({
imports: [TabModule],
standalone: true,
selector: 'app-root',
template: `
<ejs-tab id="element">
<e-tabitems>
<e-tabitem [header]="headerText[0]" [content]="content0"></e-tabitem>
<e-tabitem [header]="headerText[1]" [content]="content1"></e-tabitem>
<e-tabitem [header]="headerText[2]" [content]="content2"></e-tabitem>
</e-tabitems>
</ejs-tab>
`
})
export class AppComponent {
public headerText: object[] = [
{ text: 'Home' },
{ text: 'Settings' },
{ text: 'Profile' }
];
public content0 = 'Welcome to the home tab with your dashboard content.';
public content1 = 'Configure application settings and preferences here.';
public content2 = 'View and edit your user profile information.';
}import { Component } from '@angular/core';
import { TabModule } from '@syncfusion/ej2-angular-navigations';
@Component({
imports: [TabModule],
standalone: true,
selector: 'app-root',
template: `
<ejs-tab id="element">
<e-tabitems>
<e-tabitem [header]="headerText[0]" [content]="content0"></e-tabitem>
<e-tabitem [header]="headerText[1]" [content]="content1"></e-tabitem>
<e-tabitem [header]="headerText[2]" [content]="content2"></e-tabitem>
</e-tabitems>
</ejs-tab>
`
})
export class AppComponent {
public headerText: object[] = [
{ text: 'Home' },
{ text: 'Settings' },
{ text: 'Profile' }
];
public content0 = 'Welcome to the home tab with your dashboard content.';
public content1 = 'Configure application settings and preferences here.';
public content2 = 'View and edit your user profile information.';
}// Add new tab at specific index
const newTab = {
header: { text: 'New Tab' },
content: 'New content here'
};
this.tabObj.addTab([newTab], 2);// 在指定索引处添加新标签
const newTab = {
header: { text: 'New Tab' },
content: 'New content here'
};
this.tabObj.addTab([newTab], 2);// Handle tab selection changes
onTabSelected(args: SelectEventArgs) {
console.log('Selected tab index:', args.selectedIndex);
// Refresh data for selected tab
this.loadDataForTab(args.selectedIndex);
}// 处理标签选择变化
onTabSelected(args: SelectEventArgs) {
console.log('Selected tab index:', args.selectedIndex);
// 刷新选中标签的数据
this.loadDataForTab(args.selectedIndex);
}public headerText: object[] = [
{ text: 'Dashboard', iconCss: 'e-icons e-home' },
{ text: 'Products', iconCss: 'e-icons e-shopping-cart' },
{ text: 'Orders', iconCss: 'e-icons e-receipt' }
];public headerText: object[] = [
{ text: 'Dashboard', iconCss: 'e-icons e-home' },
{ text: 'Products', iconCss: 'e-icons e-shopping-cart' },
{ text: 'Orders', iconCss: 'e-icons e-receipt' }
];// Use Dynamic mode for memory optimization
<ejs-tab
loadOn="Dynamic" // Only active content in DOM
heightAdjustMode="Auto">
</ejs-tab>// 使用动态模式优化内存
<ejs-tab
loadOn="Dynamic" // 仅激活内容在DOM中
heightAdjustMode="Auto">
</ejs-tab>// Tab component has built-in keyboard support
// Tab key - focus next header
// Arrow keys - navigate between tabs
// Enter/Space - activate tab
// Users can switch tabs without mouse// Tab组件内置键盘支持
// Tab键 - 聚焦下一个标签头
// 方向键 - 在标签间导航
// Enter/Space键 - 激活标签
// 用户无需鼠标即可切换标签itemsselectedIndexheightAdjustModeloadOnoverflowModeanimationallowDragAndDropdragAreareorderActiveTabheaderPlacementenablePersistencelocalescrollStep.select(index).addTab(items, index).removeTab(index).hideTab(index, hide).refresh().dataBind()selectingselectedonDragStartdraggingdraggedcreateddestroyeditemsselectedIndexheightAdjustModeloadOnoverflowModeanimationallowDragAndDropdragAreareorderActiveTabheaderPlacementenablePersistencelocalescrollStep.select(index).addTab(items, index).removeTab(index).hideTab(index, hide).refresh().dataBind()selectingselectedonDragStartdraggingdraggedcreateddestroyed