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

@winner-fed/plugin-element-ui

v1.0.2

Published

A WinJS plugin for Element UI to automatically import components and use tree-shaking to reduce the size of the bundle.

Readme

winjs-plugin-element-ui

适配 WinJS 的 Element UI 插件,为 Vue 2 项目提供 Element UI 组件库的自动导入和配置支持。

功能特性

  • 🚀 自动导入: 支持 Element UI 组件的按需自动导入
  • 📦 零配置: 开箱即用,无需手动配置组件导入
  • 🔧 集成性: 与 WinJS 框架深度集成
  • 🎯 Vue 2 兼容: 专为 Vue 2 项目设计

安装

npm install @winner-fed/plugin-element-ui element-ui
# 或者
yarn add @winner-fed/plugin-element-ui element-ui
# 或者
pnpm add @winner-fed/plugin-element-ui element-ui

快速开始

1. 在 .winrc.ts 中配置插件

import { defineConfig } from 'win';

export default defineConfig({
  plugins: [
    require.resolve('@winner-fed/plugin-element-ui')
  ],
  elementUI: {
    // 插件配置选项(可选)
  }
});

2. 在 Vue 组件中使用

插件会自动处理 Element UI 组件的导入,你可以直接在模板中使用:

<template>
  <div>
    <el-button type="primary">主要按钮</el-button>
    <el-button type="success">成功按钮</el-button>
    <el-input v-model="input" placeholder="请输入内容"></el-input>
    <el-date-picker
      v-model="date"
      type="date"
      placeholder="选择日期">
    </el-date-picker>
  </div>
</template>

<script>
export default {
  data() {
    return {
      input: '',
      date: ''
    }
  }
}
</script>

配置选项

elementUI

类型:object

Element UI 相关配置,目前支持的配置项:

export default defineConfig({
  elementUI: {
    // 未来可能会添加更多配置选项
  }
});

工作原理

本插件通过以下方式实现 Element UI 的集成:

  1. 自动检测依赖: 插件会自动检测项目中是否安装了 element-ui
  2. 配置解析器: 使用 unplugin-vue-componentsElementUiResolver 来处理组件的自动导入
  3. 版本信息: 自动读取 Element UI 的版本信息并注入到应用数据中
  4. 按需导入: 只导入实际使用的组件,减少打包体积

依赖要求

  • Vue 2.x
  • Element UI 2.15.13+
  • WinJS 框架

示例代码

<!-- src/pages/index.vue -->
<template>
  <div>
    <h2>Welcome to WinJS + Element UI!</h2>
    <el-button type="primary">我是 Element UI 的按钮</el-button>
    <el-input v-model="message" placeholder="输入一些内容"></el-input>
  </div>
</template>

<script>
export default {
  data() {
    return {
      message: ''
    }
  }
}
</script>

常见问题

Q: 插件无法找到 Element UI 包?

A: 确保已经安装了 element-ui 依赖:

npm install element-ui

Q: 组件样式没有生效?

A: Element UI 的样式需要单独引入,可以在入口文件中添加:

// 在 main.js 或入口文件中
import 'element-ui/lib/theme-chalk/index.css'

Q: 如何使用 Element UI 的按需导入?

A: 插件已经自动配置了按需导入,你只需要在模板中使用组件即可,无需手动导入。

许可证

MIT.