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 🙏

© 2024 – Pkg Stats / Ryan Hefner

e6date

v1.0.0

Published

此组件为 e6date 组件,基于vue以及moment.js封装的日历选择组件。 如有bug和其他需求,请联系作者进行扩展和修改。

Downloads

3

Readme

此组件为 e6date 组件,基于vue以及moment.js封装的日历选择组件。 如有bug和其他需求,请联系作者进行扩展和修改。

1.安装

npm i e6date

2.用法

main.js 中进行导入和使用:

import E6Date from 'e6date'  
Vue.use(E6Date);  

对应页面模板中使用:

import E6Date from 'e6date'  

<script>
export default {
    components:{
        E6Date
    }
}
</script>
// 单选
<e6-date 
    label="2019-01-01 12:30:00" 
    :common="commonDate"
    v-on:checked="checkedDate"
    format="YYYY-MM-DD hh:mm:ss">
</e6-date>
// 日期/时间段选择
<e6-date 
    label="2019-01-01 12:30:00" 
    label_second="2019-01-05 12:30:00" 
    period 
    :common="commonDate"
    format="YYYY-MM-DD hh:mm:ss">
</e6-date>

commonDate:[0,-1,-7,-30]

3.配置

| 参数 | 类型 | 是否必须 | 默认值 | 说明 | | :-----------: | :------: | :------: | -------------------- | :----------------------------------------------------------: | | format | String | 否 | "YYYY-MM-DD hh:mm:ss" | 格式化,默认为完整形态,可灵活配置,下面详解| | common | Array | 否 | [] | [0,-1,-7,-30]以此为例,为number数组,是快捷选择的配置项 | | label | String | 否 | '' | 默认显示时间(单选/时间段开始时间) | | label_second | String | 否 | '' | 默认显示时间(时间段结束时间) | | period | Boolean | 否 | false | 是否选择时间段 | | v-on:checked | Function | 否 | undefined | 组件中选中的结果通知父组件的回调方法 |

format:

默认:"YYYY-MM-DD hh:mm:ss"
YYYY:年
MM:月
DD:日
hh:小时
mm:分钟
ss:秒
-:日期分隔符
::时间分隔符
(空格):日期和时间的分隔符
以上内容,包含分隔符,为既定规则,不允许修改

1、如果只需要选择日期,不选择时间,则 "YYYY-MM-DD" 指定即可;
2、如果不需要选择秒,则"YYYY-MM-DD hh:mm"即可;
3、有既定的顺序规则,不允许中间空配或者间隔选配;

common:

快捷选择自定义,可传入 [0,-1,-7,-30] 类似的数组,
此例意思为会出现“今天,昨天,7天前,30天前” 的快捷选择,

若传 >0 的数,则为未来的N天;
若传 =0 的数,则为当天;
若传 <0 的数,则为过去的N天;

4.回调函数

a.选中回调

v-on:checked="checkedDate"
// 传入方法名,在选中时自动回调
checkedDate(val){
    console.log(val);
    // 单选返回选择的日期事件字符串 "2019-01-01 12:30:00" 
    // 多选返回对象 {s:"2019-01-01 12:30:00",e:"2019-01-05 12:30:00"}
}