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

@green-plum-boiling-wine/yt-element-ui

v2.1.1

Published

银泰系 ERP 前端私有组件库:Vue3 + Element Plus(表单 / 表格 / 弹窗表单 / 上传)、列表页布局、Axios 请求约定、权限指令;与租务/报表/营销等 Vue2 老栈并存时由新业务线优先接入。

Readme

@green-plum-boiling-wine/yt-element-ui

银泰 Vue 3 + Element Plus 私有组件与工具集合,对齐《租务等 ERP 前端抽离》中「列表壳、请求层、权限、上传」等可复用层;不替代现有 Vue2 + Element UI 老项目,供新系统或逐步升级的子应用接入。

定位与版本

| 能力 | 说明 | |------|------| | UI | Form / Table / TableForm / DialogForm / UploadPageLayout(搜索区 + 内容区,对应老项目 MainContent 思路) | | 请求 | createYtHttpClient:Token、ModuleId 头、业务 code/sub_code、未授权码回调(默认对齐租务常见约定) | | 权限 | v-hasPermi / v-hasRoleconfigureYtPermissionsetYtPermissionRolesAndCodes(可配置本地存储键名) | | 工程 | Vite 分包构建(es/lib/),TypeScript |

依赖(peer 由业务安装):vue@^3.2element-plus@^2.xaxios

安装

pnpm add @green-plum-boiling-wine/yt-element-ui element-plus vue axios

全局注册

import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import YtElementUI from '@green-plum-boiling-wine/yt-element-ui';
import '@green-plum-boiling-wine/yt-element-ui/lib/index/style.css';

const app = createApp(App);
app.use(ElementPlus);
app.use(YtElementUI);

注册后可用:FormDialogFormTableTableFormUploadPageLayout,以及指令 v-hasPermiv-hasRole

权限数据

登录后写入角色与权限码(默认键名 AD_ROLE / AD_PERMI,可与后端约定后 configureYtPermission 修改):

import { setYtPermissionRolesAndCodes, configureYtPermission } from '@green-plum-boiling-wine/yt-element-ui';

configureYtPermission({
  storage: 'localStorage',
  keys: { roleStorageKey: 'AD_ROLE', permiStorageKey: 'AD_PERMI' },
});
setYtPermissionRolesAndCodes(['admin'], ['order:view', 'order:edit'], 'localStorage');

模板中:

<el-button v-hasPermi="'order:edit'">编辑</el-button>

兼容旧 API:setPermission 仍可用,等价于 setYtPermissionRolesAndCodes

HTTP 客户端(与各 ERP 后端约定)

import { createYtHttpClient } from '@green-plum-boiling-wine/yt-element-ui';
import { ElMessage } from 'element-plus';
import { useRouter } from 'vue-router';

const router = useRouter();

export const http = createYtHttpClient({
  baseURL: import.meta.env.VITE_API_BASE,
  getToken: () => localStorage.getItem('token'),
  getModuleId: () => sessionStorage.getItem('moduleId'),
  onUnauthorized: async () => {
    await router.replace('/login');
  },
  onBusinessError: (msg) => ElMessage.error(msg),
});

可通过 getBusinessCode / successCodes / unauthorizedCodes 覆盖不同子系统的响应体差异。

列表页布局 PageLayout

<template>
  <PageLayout title="销售提报" search>
    <template #search>
      <el-form :inline="true" :model="query">...</el-form>
    </template>
    <template #search-actions>
      <el-button type="primary" @click="fetch">查询</el-button>
    </template>
    <Table v-bind="tableProps" />
  </PageLayout>
</template>

按需路径

构建产物按子包输出,例如:

import { Table } from '@green-plum-boiling-wine/yt-element-ui/es/table/index.es.js';
import '@green-plum-boiling-wine/yt-element-ui/es/table/style.css';

推荐以主入口 import { ... } from '@green-plum-boiling-wine/yt-element-ui' 为准,由业务侧打包工具做 tree-shaking。

文档与开发

  • 组件演示与说明:pnpm docs:dev(VitePress,见 docs/)。
  • 构建:pnpm run build

许可证

MIT