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

vue-component-dateselect

v1.0.1

Published

typescript+vue开发的日期滚轮组件,基于iosselect库进行封装,简单易用

Downloads

7

Readme

vue 日期滚轮组件

typescript+vue开发的日期滚轮组件,基于iosselect库进行封装,简单易用。组件在iosselect的基础上进行了扩展,让使用者对于日期的定义变得更加简单易用,无需使用者单独处理,使用者只需要定义开始日期当前日期结束日期即可。对于iosselect原来的option配置没有做任何的修改,使用者可以参考github上iosselect的配置,即可完成自己想要的配置设置

备注:该日期滚轮组件,目前只是支持3级的定义,最后感谢iOSselect库的开发者跟维护者们

npm NPM Version npm

iOSselect

html下拉菜单select在安卓和IOS下表现不一样,iosselect正是为统一下拉菜单样式而生,我们以IOS下select的交互和样式为蓝本,开发了这一组件。

主要维护人员

https://github.com/zhoushengmufc

https://github.com/pengweifu

官网

http://zhoushengfe.com/iosselect/website/index.html

特点

  • 0依赖,只需引用一个js和css即可
  • 样式可自己定制,也可使用默认样式
  • 一个页面同时实例化多个组件
  • jquery zepto angular vue react均适用
  • 支持最多6级级联
  • 支持设置高度和高度单位
  • 适用于android和iOS设备(PC端支持IE9+,不过PC端上滑动体验不太实用)

代码示例

组件通过v-model数据双向绑定来控制显示跟隐藏

image

  • 安装组件包

      npm install vue-component-dateselect --save-dev
  • js代码

    import Vue from 'vue';
    import VueDselect from "vue-component-dateselect";
    
    new Vue({
      el: '#app',
      components: {
        VueDselect
      },
      data() {
        return {
            visible: true,
            options: {
              config: {
                level: 3,
                title: "请选择时间",
                sureText: "确定",
                closeText: "取消",
                showAnimate: true,
              },
              data: {
                currentDate: "2017-06-29",
                beginDate: "2000-01-01",
                endDate: "2018-08-29",
              }
            }
          }
      },
      methods: {
        confirmHandle: function (yearModel, monthModel, dayModel) {
            console.log(yearModel);
            console.log(monthModel);
            console.log(dayModel);
          }
      }
    });
  • html模板

    <div id="app">
      <vue-dselect
        v-model="visible"
        @on-ok="confirmHandle"
        :option="options">
      </vue-dselect>
    </div>
    <script src="https://cdn.bootcss.com/vue/2.5.16/vue.min.js"></script>
    <script src="./dist/index.js"></script>

组件API

  • 组件 props

| 属性 | 说明 | 类型 | 默认值 | | ------ | ---------------------------------------- | ------ | ---- | | option | option对象提供2个属性值:config:iosselect组件提供的配置项,详情请参考iosselectdata:使用者自定义的日期,该属性有3个属性值:beginDate(开始时间:yyyy-MM-dd格式),endDate(结束时间:yyyy-MM-dd格式),currentDate(当前时间:yyyy-MM-dd格式) | object | 空对象 |

  • 组件 events

| 方法名称 | 说明 | 参数 | | ----- | ------------ | ---------------------------------------- | | on-ok | 点击组件【确定】按钮触发 | 事件参数有3个:yearModel:选中的年份数据对象,monthModel:选中的月份数据对象,dayModel:选中的天数据对象 |

组件开发说明

  • 安装依赖

    npm/cnpm install
  • 编译

    npm run build
  • demo运行

    # cd test
    # npm/cnpm install
    # npm run build
    
    #把test目录的index.html在浏览器打开,切换到移动的端模拟器,可以预览在手机端的展示结果

最后,欢迎大家使用,并且issue