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

moment-ui

v1.0.3

Published

A Vue.js project

Downloads

6

Readme

MomentUI

一个基于Vue和ElementUI的扩展UI组件库

https://element.eleme.cn/#/zh-CN/component/installation

用于业务统一封装

方式一:CDN引入

<script src="https://cdn.jsdelivr.net/npm/moment-ui@1.0.2/dist/moment-ui.js"></script>

Hello world

<html lang="en">
  <head>
    <script src="https://cdn.bootcss.com/vue/2.6.10/vue.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/moment-ui@1.0.2/dist/moment-ui.js"></script>
  </head>

  <body>
    <div id="app">
      
      <mo-button></mo-button>
      
    </div>

    <script>
      new Vue({
        el: "#app",
      });
    </script>
  </body>
</html>

方式二:NPM

npm i moment-ui -S

main.js

import Vue from 'vue'
import App from './App.vue'
import MomentUI from 'moment-ui'

Vue.use(MomentUI)

new Vue({
  el: '#app',
  render: h => h(App)
})

使用示例

mo-button 是对业务按钮的统一封装

<mo-button />
<mo-button type='success' />
<mo-button type='edit' />
<mo-button type='delete' />
<mo-button type='detail' />

this.$msg.success('message') 确保只有一个弹框

<div>
  <el-button @click="handleClickSuccess">single弹框</el-button>
</div>

mo-switch兼容传递过来的数字0/1和字符串'0'/'1'

<div>
  <mo-switch v-model="switchValue"
    @change="handelSwitchChange" />
</div>

mo-text 用于显示文本,如果文本为空替换为默认值

<div>
  <mo-text text="" />
  <mo-text text=""
    empty="x" />
</div>

mo-join 用于显示列表数据,如果文本为空替换为默认值

<div>
  <mo-join :list="[1, 2, 3, 0]" />

  <mo-join :list="['北京', '朝阳区']"
    separator="-" />

  <mo-join :list="[]"
    empty="x" />
</div>

mo-pagination 简化参数,并且兼容后端传递的字符串total(虽然不规范,但是避免不了有些后端人员不懂数据类型,非要传递字符串格式的数据)

<div>
  <mo-pagination total='23' />
</div>

mo-table 修改了默认的头部背景色

<div>
  <mo-table :data="tableData">

    <el-table-column prop="date"
      label="日期"
      width="180">
    </el-table-column>

    <el-table-column prop="name"
      label="姓名"
      width="180">
    </el-table-column>
    
    <el-table-column prop="address"
      label="地址">
    </el-table-column>
  </mo-table>
</div>