Import template
Template download and file import step card, preserving the legacy props, events and slots. It emits notifications only; the application handles downloads and upload requests.
Download and import
Loading example…
Download and import
Interactive example
2导入模板 / Import template
Excel (.xlsx, .xls)Max 50 MiB
Installation
ts
import NfImportTemplate from '@94ai-plus/nf-import-template'
import 'element-plus/dist/index.css'
import '@94ai-plus/nf-theme-chalk/nf-import-template.css'
app.use(NfImportTemplate)Props
| Prop | Type | Default |
|---|---|---|
| order | string | '1' |
| description | string | '' |
| btnText | string | '' |
| tip | string | '' |
| subTip | string | '' |
| tipDirection | vertical / horizontal | vertical |
| mode | downLoad / download / upload | downLoad |
| uploadMineType | string[] (extensions) | ['.xlsx', '.xls'] |
| limitSize | number (MiB, file size < limit) | 50 |
| showError | boolean | false |
| errorText | string | '' |
| loading | boolean | false |
Events
| Event | Payload |
|---|---|
| click | MouseEvent (downLoad / download) |
| upload | File (upload) |
| emit-error | — (showError) |
Slots
| Slot | Content |
|---|---|
| default | description |
| tip | tip + subTip |
Migration notes
The actual defaults are mode="downLoad" and tipDirection="vertical"; download is also accepted. Extensions are case-insensitive. File size must be strictly less than limitSize MiB. Cancelled selections are safe, and the same file can be selected again. Applications must validate content and server limits.
showError: errorText || lastValidFileName. loading: no click/upload. $openMessage.error → ElMessage.error.
