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

@ptengine/ui-vue

v0.3.1

Published

Ptengine 基础组件的 Vue 3 包装层。由 @ptengine/ui 构建时自动生成,不手写。

Readme

@ptengine/ui-vue

@ptengine/ui 的 Vue 3 包装层。由构建自动生成,不手写 —— src/components.ts 是 Stencil 的 Vue output target 在 pnpm build 时产出的。

安装

npm i @ptengine/ui-vue

样式表

不用手动引:第一个组件连上页面时,会把设计变量(ptengine-ui.css 的内容)自动挂到 document 上。

服务端渲染的项目建议手动引一次,否则 JS 到达之前首屏没有样式、会闪一下。引了的话自动注入会跳过。 放在 main.ts 里(Nuxt 见下面的 Nuxt 一节),并把 @ptengine/ui 装成直接依赖(npm i @ptengine/ui,pnpm 下间接依赖找不到):

import '@ptengine/ui/dist/ptengine-ui/ptengine-ui.css';

用法

<script setup lang="ts">
import { PtButton, PtInput } from '@ptengine/ui-vue';

const value = ref('');
</script>

<template>
  <PtInput v-model="value" />
  <PtButton variant="brand">提交</PtButton>
</template>

表单类组件已配好 v-model:文本控件绑 value,勾选类绑 checked, 切换按钮(PtToggle)绑 pressed,折叠面板(PtCollapsible)绑 open, 出口都是内核的 ptChange 事件。

事件在模板里写成短横线形式:@pt-change、@pt-close。

Nuxt

// nuxt.config.ts
export default defineNuxtConfig({
  css: ['@ptengine/ui/dist/ptengine-ui/ptengine-ui.css'],
  build: { transpile: ['@ptengine/ui-vue', '@ptengine/ui'] }
});

服务端渲染开箱可用,组件在服务端就渲染成 HTML。

轻提示(toast)

命令式的 toast() 从 @ptengine/ui/toast 导入。 <PtToaster /> 挂在根组件末尾一次即可;不挂也能用, toast() 会在 <body> 末尾建一个:

import { PtToaster } from '@ptengine/ui-vue';
import { toast } from '@ptengine/ui/toast';

// App.vue 里:<PtToaster position="top-center" rich-colors />
toast.success('已保存');

版本

与 @ptengine/ui 锁步发版、共用一个版本号。要求 Vue ≥ 3.4。