@aevantec/litevue

中文文档
0.5.17发布于 2026/11/03MITTypeScriptESM + CJS构建来源已验证近 30 天下载 2253

A maintained petite-vue fork: Vue's template syntax and reactivity in ~11kb, with built-in devtools. No build step.

原始使用文档
文档目录5 节
  1. Quick start
  2. Documentation
  3. Development
  4. Status
  5. License

litevue

litevue is a fork of petite-vue by Evan You — an alternative distribution of Vue optimized for progressive enhancement: sprinkling interactivity onto server-rendered HTML with the same template syntax and reactivity mental model as standard Vue.

Published on npm as @aevantec/litevue — the unscoped name is blocked by an unrelated lite-vue package. The IIFE/UMD global stays LiteVue.

  • ~11kb gzipped core, driven by the real @vue/reactivity
  • Vue-compatible syntax: {{ }}, v-if/v-for (keyed), v-model, v-show, …
  • Built-in devtools — in-page inspector panel + browser extension, one line to disable in production
  • Transitions that work with v-show and v-if (deferred unmount)
  • Plugin system with eleven first-party plugins: intersect, persist, focus (+trap), collapse, transition, mask, morph, media, resize, popover (+anchor), and navigate
  • Lazy mounting — v-scope.visible, .idle and .interaction leave a region unbound until it is seen, the browser is idle, or it is first used
  • Components registered by name with app.component(), usable from v-scope
  • Global store (store() / $store) and magic properties ($dispatch, $watch, $id, $root, …)
  • Cached derived state with computed(), alongside reactive() and watchEffect()
  • Extra event modifiers: .outside, .window, .debounce, .throttle, animation-event filters
  • Error diagnostics that name the directive, element and expression — and suggest the name you meant — plus app.onError() for monitoring in production
  • Development builds with warnings for common mistakes, picked automatically by Vite and webpack while you develop
  • Safe with dynamic content: injected markup stays inert until explicitly mounted, and morph updates a server-rendered region in place without losing scope state, focus or scroll

Quick start

<script src="https://unpkg.com/@aevantec/litevue" defer init></script>

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

Or with a bundler:

npm install @aevantec/litevue
import { createApp } from '@aevantec/litevue';

createApp({ count: 0 }).mount();

Documentation

Full documentation lives in the docs site (source in docs/, pnpm docs:dev to run locally):

  • Introduction — what it is, Vue compatibility, limitations, security and CSP
  • Installation — CDN, npm, mount options, and development builds
  • Essentials — state, templating, components, lifecycle, dynamic content, server-driven HTML, resources, forms, error handling
  • Directives — a page per directive, with live demos
  • Magics — $el, $store, $dispatch, $watch, $id, …
  • Globals — createApp(), store(), reactive(), computed(), watchEffect(), nextTick(), the devtools API
  • Plugins — all first-party plugins, and writing your own
  • Devtools — inspector panel, browser extension, production kill-switch
  • Migrating from petite-vue · Coming from Alpine

Development

pnpm install
pnpm dev        # every example and playground page, at localhost:3000
pnpm test       # vitest suite
pnpm build      # core, devtools and plugin bundles, production and development
pnpm docs:dev   # documentation site

See CHANGELOG.md for the fork's history.

Status

litevue continues from petite-vue 0.4.1, which is no longer actively maintained upstream. It aims to stay aligned with standard Vue behavior so code can graduate to Vue with minimal friction.

License

MIT. Original petite-vue by Evan You; fork additions by the litevue contributors.

版本与发布记录

@aevantec/litevue 共发布 18 个版本,首次发布于 2026/07/27;过去 12 个月发布了 18 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.5.17latest2026/11/034 天前
0.5.162026/10/2612 天前
0.5.152026/10/1820 天前
0.5.142026/10/1721 天前
0.5.132026/10/1721 天前
0.5.122026/10/1721 天前

关于 @aevantec/litevue 的常见问题

@aevantec/litevue 是什么?

A maintained petite-vue fork: Vue's template syntax and reactivity in ~11kb, with built-in devtools. No build step.

如何安装 @aevantec/litevue?

在项目目录运行 npm install @aevantec/litevue,或使用 pnpm add / yarn add / bun add。

@aevantec/litevue 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aevantec/litevue 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@aevantec/litevue 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aevantec/litevue 可以商用吗?

@aevantec/litevue 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@aevantec/litevue 的下载量有多少?

根据 npm 官方下载统计,@aevantec/litevue 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,253 次,日均约 75 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aevantec/litevue 还在维护吗?

最新版本 0.5.17 发布于 2026/11/03(4 天前);至今共发布 18 个版本,其中过去 12 个月发布了 18 个;首次发布于 2026/07/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。