Skip to content

Latest commit

 

History

History
81 lines (56 loc) · 2.53 KB

File metadata and controls

81 lines (56 loc) · 2.53 KB

pocket-vue

npm version License: MIT

A maintained fork of petite-vue — an ultra-lightweight distribution of Vue optimized for progressive enhancement. It provides the same template syntax and reactivity mental model as standard Vue, without the overhead of a full SPA.

Note: petite-vue is no longer maintained. pocket-vue picks up where it left off with bug fixes and feature requests.

Why pocket-vue?

  • ~9kb gzipped — drop it in, no build step required
  • Vue-compatible — same template syntax and reactivity you already know
  • Progressive enhancement first — layer interactivity onto existing server-rendered pages
  • Framework friendly — works with Django, Rails, Laravel, ASP.NET, or any server-side setup

Quick Start

<script src="https://unpkg.com/pocket-vue" defer init></script>

<div v-scope="{ count: 0 }">
  {{ count }}
  <button @click="count++">Increment</button>
</div>

CDN

<script src="https://unpkg.com/pocket-vue"></script>
<!-- or -->
<script src="https://cdn.jsdelivr.net/npm/pocket-vue"></script>

npm

npm install pocket-vue
import { createApp } from 'pocket-vue'

Installation

For detailed setup instructions, bundle options, and usage with various frameworks, see the full documentation.

Features

Directive Description
v-scope Declare reactive state
v-model Two-way data binding
v-if / v-else Conditional rendering
v-for List rendering
v-on / @ Event handling
v-bind / : Attribute binding
v-text Text content binding
v-html Inner HTML binding
v-show Toggle visibility
v-effect Reactive side effects

Documentation

Full documentation, guides, and API reference are available at pocket-vue.wusaby.com.

To run the docs locally:

pnpm docs:dev

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

License

MIT