Skip to content

Vue Compatibility

pocket-vue uses Vue-style template syntax and Vue's reactivity package, but it is not the full Vue runtime. Use this page to check which Vue features are supported, partially supported, or intentionally omitted.

Supported

FeatureNotes
InterpolationText interpolation with or custom delimiters.
v-scopeCreates a reactive scope for an element.
v-if, v-else-if, v-elseConditional rendering.
v-forArrays, objects, numbers, and basic destructuring.
v-modelText inputs, textareas, checkboxes, radios, and selects.
v-bind / :Attribute, class, style, object, and :ref bindings.
v-on / @DOM event listeners, common modifiers, key modifiers, and @vue:mounted / @vue:unmounted.
v-showToggles inline display.
v-text, v-html, v-cloak, v-pre, v-onceSupported as lightweight directives.
refStores DOM elements on $refs.
reactive()Re-exported from @vue/reactivity.
watchEffect()Alias for effect from @vue/reactivity; returns the effect runner.

Different from full Vue

Areapocket-vue behavior
ComponentsComponents are plain functions or objects returned from v-scope; there are no SFCs, render functions, props validation, emits, slots, or setup().
Refsref stores DOM elements, including elements that also have v-scope. It does not return a Vue component instance.
Reactivity exportsOnly reactive() and watchEffect() are exported from pocket-vue. Import ref(), computed(), and other APIs from @vue/reactivity if needed.
Event listeners@event listeners are attached to DOM elements. app.unmount() stops reactive effects and directive cleanup callbacks, but native event listeners remain attached until the DOM elements are removed or the browser releases them.
ExpressionsTemplate expressions are evaluated at runtime with new Function() and are rejected if they match pocket-vue's unsafe-expression checks.
Mountingapp.mount(selector) returns undefined if the selector does not match an element.
CSPStrict Content Security Policies that block new Function() are not supported.

Unsupported Vue syntax

Vue featureWhat to use instead
Single-file components (.vue)Plain HTML plus v-scope objects/functions.
createApp(Component) root componentscreateApp(initialData).mount(target).
setup(), data(), methods, computed optionsReturn or pass a plain object with fields, methods, and JavaScript getters.
props, emits, provide / injectPass values through functions, parent scopes, or shared reactive stores.
Slots and scoped slotsUse normal HTML/template fragments and v-scope functions.
TransitionsUse CSS and lifecycle events manually.
v-on="object"Use individual event bindings like @click="onClick".
Full Vue app config/pluginspocket-vue plugins only receive the pocket-vue app instance and can register directives or mutate app state.

When to choose full Vue instead

Use full Vue if you need SFCs, router-driven SPA behavior, rich component contracts, SSR hydration, strict CSP without unsafe-eval, or the full Composition API from the vue package.

Released under the MIT License.