Global configuration
NfConfigProvider validates plugin registration, template types, internationalization and theme switching.
Switch the language to update the confirm/cancel buttons and empty-state text. Confirm increments the counter; cancel resets it. Switch Chalk/OEM to change the primary button and preview border between blue #1177ff and green #007555. Language and component theme are independent.
Button labels read the language pack through useLocale().t(); NfButton does not translate custom slot content automatically. The current provider shares the application's locale context and applies its theme to the application root. This example runs in an isolated preview, so it does not change the documentation navigation's language or theme.
Element Plus global configuration
NfConfigProvider reuses all ConfigProvider props, validators and defaults from the installed Element Plus version and forwards the default scoped slot's config. For example, size controls nested ElButton and ElInput components without an explicit size; component-level props take priority. button, card, dialog, link, table, message, zIndex, namespace, a11y, keyboardNavigation, experimentalFeatures, emptyValues and valueOnClear are forwarded with Element Plus's native nesting/merge behavior.
The example also demonstrates button.autoInsertSpace, translated Element Plus pagination and the scoped slot.
A string locale selects the CommonUI language and the matching built-in Element Plus language pack. Supported names are zh-CN, en-US, ja, es, id, th, tl and pt; Tagalog uses this repository's adapter. A language-pack object behaves like ElConfigProvider's locale. An explicit elementPlusLocale takes precedence. Custom language names require a separate Element Plus language pack.
Common UI global configuration
Set default props through camelCase keys such as nfForm, nfTable, nfDrawer, and nfSoftphone; template attributes may use nf-form or nf-table.
Priority: explicit component props → nearest provider → outer providers → original defaults. Merge by prop; undefined inherits, while false, 0, and empty strings override. Arrays, objects, and functions replace whole values. Configuration is reactive; initialization options retain their existing lifecycle. Set required business data, listeners, slots, and native attributes locally.
Call useMessage(), useNotification(), and useConfirm() in a child setup to inherit the current provider. Direct services without context and softphone manager instances do not read the component tree.
NfButton
NfButton retains its legacy mini / small / medium sizes and does not inherit Element Plus's global size.
NfAction
NfAlert
NfAudio
NfConditions
NfConfirm
NfMessage
NfNotification
NfDatePicker
NfDrawer
NfEmpty
NfForm
NfFormItem
NfImportTemplate
NfIndicatorPlane
NfInfiniteMenu
NfKeywords
NfLazySelect
NfPopupLazySelect
NfRadioGroup
NfResizablePanels
Drag the divider to resize the panels.
NfRules
NfSearchForm
NfSoftphone
Global defaults disable auto-start and configure the phone language, OEM theme, and PC mode. This follows the softphone documentation’s async onMounted example: it renders an unconnected preview bar by default, and obtains a signature to initialize the live phone bar after entering test appKey, appSecret, and agentTag values in the editor.
NfTable
NfTag
NfTextOverflow
NfTransferSelect
NfVariableSelect
NfVirtualSelect
NfHalfYearPicker
NfHalfYearRangePicker
NfWeekRangePicker
nfButton、nfAction、nfAlert、nfAudio、nfConditions、nfConfirm、nfDatePicker、nfDrawer、nfEmpty、nfForm、nfFormItem、nfImportTemplate、nfIndicatorPlane、nfInfiniteMenu、nfKeywords、nfLazySelect、nfMessage、nfNotification、nfPopupLazySelect、nfRadioGroup、nfResizablePanels、nfRules、nfSearchForm、nfSoftphone、nfTable、nfTag、nfTextOverflow、nfTransferSelect、nfVariableSelect、nfVirtualSelect、nfHalfYearPicker、nfHalfYearRangePicker、nfWeekRangePicker
Half-year, half-year range and week range pickers read their own configuration first, then inherit unset props from nfDatePicker.
Props
| Prop | Type | Default |
|---|---|---|
| locale | string | Element Plus Language | Inherited context |
| theme | 'chalk' | 'oem' | chalk |
| element-plus-locale | object | - |
| size | '' | 'large' | 'default' | 'small' | Inherited context |
| nf-alert, nf-form, nf-table and other component keys | Corresponding props object in NfComponentConfig | Inherited per property |
| Other Element Plus props | Same as the installed ElConfigProvider | Element Plus defaults |
Default scoped slot: { config }, the merged Element Plus configuration, excluding Nf's theme and string locale.
