@encody/vue2
v0.5.0
Published
Encody client SDK — resumable upload queue with Vue 2.7 composables
Readme
@encody/vue2
TUS-based resumable upload queue with a Vue 2.7 composable. Same API as @encody/vue, adapted for Vue 2.7's reactivity system.
Install
npm install @encody/vue2Requires Vue 2.7 or later. Vue 2.7 ships with the Composition API built-in — no extra plugins needed.
Usage
import { useEncody } from '@encody/vue2'
const { add, clear, files, isActive } = useEncody({
token: () => getTokenFromBackend()
})All options accept a raw value or a Vue ref — the composable stays reactive either way.
API
The composable API is identical to @encody/vue. See the full documentation for options, return values, events, and examples.
Vue 2 differences
- Uses
reactive({})(plain object) internally instead ofreactive(new Map())— Vue 2'sObject.defineProperty-based reactivity does not support Map/Set. toValueis polyfilled locally (it was added in Vue 3.3).- Only Vue 2.7+ is supported (no
@vue/composition-apiplugin required).
