npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@variojs/vue

v0.5.9

Published

Vario Vue Renderer - Vue 3 integration for Vario Schema rendering

Readme

🎨 @variojs/vue

Vario Vue 渲染器 - 深度集成 Vue 3 的 Schema 渲染器

特点

  • 🚀 深度集成:完整支持 Vue 3 Composition API
  • 📦 声明式 Schema:JSON Schema 定义 UI,简洁易维护
  • 🔄 自动响应式:状态自动包裹为响应式,支持层级依赖收集
  • 🎯 Vue 特性支持:ref、生命周期、provide/inject、teleport 等

安装

npm install @variojs/vue
# 或
pnpm add @variojs/vue

依赖的 @variojs/core@variojs/schemavue 会自动安装。

快速开始

import { useVario } from '@variojs/vue'
import type { VueSchemaNode } from '@variojs/vue'

const schema: VueSchemaNode = {
  type: 'div',
  children: [
    {
      type: 'ElInput',
      model: 'name',
      props: { placeholder: '请输入姓名' }
    },
    {
      type: 'div',
      children: '{{ name }}'
    },
    {
      type: 'ElButton',
      events: {
        click: {
          type: 'call',
          method: 'handleClick'
        }
      },
      children: '点击'
    }
  ]
}

export default {
  setup() {
    const { vnode, state, methods } = useVario(schema, {
      state: {
        name: ''
      },
      methods: {
        handleClick: ({ state, ctx }) => {
          console.log('Clicked', state.name)
        }
      }
    })
    
    return { vnode, state }
  }
}

核心特性

双向绑定

{
  type: 'ElInput',
  model: 'user.name'  // 自动创建响应式绑定
}

表达式

{
  type: 'div',
  children: '{{ firstName + " " + lastName }}',
  show: 'count > 10'
}

循环渲染

{
  type: 'div',
  loop: {
    items: '{{ userList }}',
    itemKey: 'item'
  },
  children: '{{ item.name }}'
}

Vue 特性

  • Ref 模板引用ref: 'inputRef'
  • 生命周期onMounted: 'initData'
  • Provide/Injectprovide: { theme: 'dark' }
  • Teleportteleport: 'body'

性能优化

采用 Scope-Weight Hybrid 自适应优化策略,所有优化零配置自动生效

| 优化方案 | 工作方式 | 配置 | |----------|----------|------| | path-memo | 按路径缓存 VNode,未变分支复用 | 始终开启 | | 子树组件化 | scope boundary + weight > 5 时自动拆分 | 自适应 | | 循环组件化 | 模板 weight > 5 时列表项自动包装 | 自适应 |

// 无需任何配置,优化自动生效
const { vnode, state } = useVario(schema)

详见 性能优化文档

优势

  • 类型推导:完整的 TypeScript 类型支持
  • 高性能:path-memo、列表项组件化,最高 88 倍加速
  • 自动同步:状态与运行时上下文双向同步
  • Vue 原生:computed、watch 使用 Vue 原生 API
  • 节点上下文:支持 $parent$root 访问

许可证

MIT