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

date-input-enhance

v0.0.1-alpha.9

Published

对element-ui日期组件输入功能增强,用户输入日期数字时自动替换光标位置后的日期文本,并自动保持日期格式,方便用户手动输入日期

Readme

说明

对elementUI日期组件输入功能增强,用户输入日期数字时自动替换光标位置后的日期文本,并自动保持日期格式

安装

npm install date-input-enhance

引入

import dateInputEnhance from 'date-input-enhance';
Vue.use(dateInputEnhance);

使用案例

<template>
    <div>
        <!-- 使用默认值 -->
        <div class="expamle">example0:
            <el-date-picker 
              v-model="value"
              v-date-input-enhance
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="datetime"
              placeholder="选择日期时间">
            </el-date-picker>
            &nbsp;&nbsp;<span>当前日期值:</span>{{ value }}
        </div>
          <!-- 配置对应的data名 -->
        <div class="expamle">example1:
            <el-date-picker
              v-model="value1"
              v-date-input-enhance="{ dataName: 'value1' }"
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="datetime"
              placeholder="选择日期时间">
            </el-date-picker>
            &nbsp;&nbsp;<span>当前日期值:</span>{{ value1 }}
        </div>
        <!-- 配置需要跳过的字符 -->
        <div class="expamle">example2:
            <el-date-picker
             v-model="value2"
             v-date-input-enhance="
              { 
               dataName: 'value2', 
               skipChar: ['/', ' ', ':'], 
               initData: '0000/00/00 00:00:00' 
              }"
            format="yyyy/MM/dd HH:mm:ss" 
            value-format="yyyy/MM/dd HH:mm:ss"
            type="datetime"
            placeholder="选择日期时间">
            </el-date-picker>
            &nbsp;&nbsp;<span>当前日期值:</span>{{ value2 }}
        </div>
        <!-- 配置自定义更新函数名及初始值 -->
        <div class="expamle">example3:
            <el-date-picker 
             :value="value3"
             @input="handleInput"
             v-date-input-enhance=
             "{ 
               dataName: 'value3',
               initData: '0000-00-00',
               handleInputFuncName: 'handleInput' 
             }"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            type="date"
            placeholder="选择日期时间">
            </el-date-picker>
            &nbsp;&nbsp;<span>当前日期值:</span>{{ value3 }}
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            value: '',
            value1: '',
            value2: '',
            value3: ''
        }
    },
    methods: {
        handleInput(value) {
            this.value3 = value
        }
    }
}
</script>

<style>
.expamle {
    padding: 10px;
}
</style>

参数说明

  dataName:日期组件绑定的值的属性名,默认值:'value',必须; 
  skipChar:手动输入日期时需要跳过的字符,一般是日期分割符,默认值:['-', ' ', ':'],必须;
  initData:当前日期为空用户输入日期时默认的日期,默认值:'0000-00-00 00:00:00'必须;
  handleInputFuncName: 如果需要调用自定义的日期值更新函数,则需要配置对应的函数名,可选;