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

@seresweb/website-component

v2.4.2

Published

官方网站类的组件

Downloads

1,453

Readme

@seresweb/website-component

安装

npm i @seresweb/website-component

使用

提供了完整引用和按需引用两种方式

完整引用

import { createApp } from 'vue';
import WebsiteComponent from '@seresweb/website-component';
import '@seresweb/website-component/dist/index.css';
import App from './App.vue';

const app = createApp(App);

app.use(WebsiteComponent).mount('#app');

按需引用

自动导入

安装 unplugin-vue-components

配置 vite.config.ts

import Components from 'unplugin-vue-components/vite';
import { ComponentsResolver } from '@seresweb/website-component';

export default defineConfig({
  plugins: [
    Components({
      resolvers: [ComponentsResolver()],
    }),
  ],
});

配置 tsconfig.json

{
  "compilerOptions": {
    "types": ["@seresweb/website-component/dist/global.d.ts"]
  }
}

这样可以直接在模版中使用组件,例:

<template>
  <ScDropdown />
</template>

<script setup lang="js">
// 不需要手动导入
</script>

手动导入

安装 @vavt/vite-plugin-auto-import-style

配置 vite.config.ts

import { defineConfig } from 'vite';
import LibPlugin from '@vavt/vite-plugin-auto-import-style';

export default defineConfig({
  plugins: [LibPlugin()],
});

在模版中使用组件,例:

<template>
  <ScDropdown />
</template>

<script setup lang="js">
// 需要手动导入
import { ScDropdown } from '@seresweb/website-component'
</script>

开发手册

全局组件命名规则:Sc + 组件名称,例:ScCard,其中Sc来自@seresweb/website-componentserescomponent的首字母(不采用 swc 这个保留字)。

注意!!!

开发组件 ScMyButton时,组件对应的文件夹及文件没有特殊要求,但是,要求样式文件 my-button.scss 必须是这种类型。因为 resolver.ts 中的处理逻辑限制如此!

调试

在 dev 目录下新增 test-components 目录,然后在目录下新建*.vue文件,npm run dev 启动项目,这些调试组件会自动加载到页面上。

开发流程

  1. packages/components下新增以组件名称作为组件目录。
  2. 在组件目录下新增index.ts和需要的组件,并在index.ts的完善自动注册并导出。
  3. packages/styles下新增以组件名称作为样式文件,如layz-image.scss,并在index.scss中导入。
  4. 无需修改components下的index.ts,因为已经在resolver.ts中做了自动处理。
  5. dev/test-components下调试组件。

发布

目前无自动发布流程,请在本地构建后发布(请务必拉取 main 分支后再进行本地构建))

  1. 本地构建
npm run build
  1. 更新版本号
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
1.0.0-0
| | | | - 测试版本号
| | | - 补丁版本
| | - 功能版本
| - 主版本
  1. 推送
npm publish --access public