Skip to content

Upload & Editor ​

Drag-and-drop upload with validation (type, size, count — messages translated), previews and progress (list and single variants). Editor is a lightweight contenteditable rich-text editor.

Upload ​

Upload
vue
<div class="thl-row">
  <div class="thl-col-12 thl-col-md-6"><ThlUpload multiple :max-size="2 * 1024 * 1024" accept="image/*" :request="fakeRequest" /></div>
  <div class="thl-col-12 thl-col-md-6"><ThlUpload variant="single" /></div>
</div>
tsx
<Upload multiple maxSize={2 * 1024 * 1024} accept="image/*"
  request={(file, onProgress) => api.upload(file, onProgress)} onChange={setFiles} />
<Upload variant="single" />
html
<thl-upload multiple [maxSize]="2 * 1024 * 1024" accept="image/*" [request]="upload" (filesChange)="files.set($event)" />
<thl-upload variant="single" />

Editor ​

Editor
vue
<div><ThlEditor v-model="html" :min-height="140" /><pre style="font-size:12px;margin-top:8px;white-space:pre-wrap">{{ html }}</pre></div>
tsx
<Editor value={html} onChange={setHtml} minHeight={140} />
html
<thl-editor [(value)]="html" [minHeight]="140" />

API ​

Upload

<ThlUpload> · import { ThlUpload } from '@thl-ui/vue'

PropTypeDefault
acceptstring—
maxSizenumber—
multipleboolean—
maxFilesnumber—
requestfunction—
variantstring"list"
hintstring—

Events: change

Editor

<ThlEditor> · import { ThlEditor } from '@thl-ui/vue'

PropTypeDefault
modelValuestring""
placeholderstring—
minHeightnumber—
ariaLabelstring—

Events: update:modelValue