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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vue-function-component

v1.0.7

Published

Vue3 function component is similar to React function component in implementing memory state hooks

Readme

vue-function-component 发行文件选择指南

一、直接通过 <script> 标签在浏览器中使用

文件:vueFunctionComponent.global.js(开发版) / vueFunctionComponent.global.prod.js(生产版)

特点:

以 IIFE(立即调用函数表达式)形式提供,通过全局变量 Vue 暴露接口。
生产版已预压缩,推荐在生产环境中使用。
使用场景:
快速原型开发或小型项目,无需构建步骤。

二、使用原生 ES 模块(\<script type="module">)

文件:vueFunctionComponent.esm.js(开发版) / vueFunctionComponent.esm.prod.js(生产版)

特点:

ES 模块格式,支持浏览器原生导入。

使用场景:

在浏览器中直接使用 ES 模块。

三、服务端渲染(SSR)

CommonJS 格式

文件:vueFunctionComponent.cjs.js(开发版) / vueFunctionComponent.cjs.prod.js(生产版)

特点:

CommonJS 格式,适用于 Node.js 环境。
自动根据 process.env.NODE_ENV 选择开发版或生产版。

使用场景:

在 Node.js 中进行服务端渲染。
配合构建工具(如 webpack)使用,设置 target: 'node' 并正确外部化 Vue 依赖。

总结:

直接浏览器使用:选择 `vueFunctionComponent.global.js` 原生 ES 模块:选择 `vueFunctionComponent.esm.js` 服务端渲染:选择 `vueFunctionComponent.cjs.js`。

生产环境中,请务必使用预压缩的生产版文件(以 .prod.js 结尾),以获得更好的性能和更小的文件体积。

具体使用请看该文档