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

@weex-project/weex-picker

v0.2.4

Published

weex picker extend

Downloads

12

Readme

weex-picker

weex-picker是一个weex插件,可以通过weexpack快速集成,可以丰富weex功能

  • 支持的weexpack版本: >= 0.2.0
  • 支持的WeexSDK版本: >= 0.14.0
  • 支持的Vue版本: 2.x

weex-picker仅支持weex的web端的picker功能,如无需picker功能,无需引入.

示例

  • 编译例子
  npm run build:examples
  • 启动调试服务器
  npm run serve

打开 localhost:12580 查看例子.

如何使用

  • 步骤 1
  npm install  @weex-project/weex-picker --save-dev
  • 步骤 2

    ~~你需要在引入weex-vue-render之后进行模块注册,具体可参考根目录下的./playground/browser/plugininstall.js~~

    目前模块的注册加入了源码中,请保证在weex环境加载之后引入

  <script src="../../../node_modules/vue/dist/vue.runtime.js"></script>
  <script src="../../../node_modules/weex-vue-render/dist/index.js"></script>
  <script src="../../../node_modules/@weex-project/weex-picker/js/build/index.js"></script>
  • 步骤 3
  const picker = weex.requireModule('picker');
  picker.pick({
    items: [1, 2, 3, 4],
    height: "500px"
  }, function(ret) {
      var result = ret.result;
      if (result == 'success') {
        self.normalpickData = ret.data;
    }
  })

概述

以下为 picker 相关的 API,用于数据选择,日期选择,时间选择。

API

pick(options, callback[options])

调用单选 picker

参数

  • options {Object}:调用单选 picker 选项

    • index {number}:默认选中的选项
    • items {array}:picker 数据源
  • callback {function (ret)}:执行完读取操作后的回调函数。ret {Object}callback 函数的参数,有两个属性:

    • result {string}:结果三种类型 success, cancel, error
    • data {number}:选择的选项,仅成功确认时候存在。

pickDate(options, callback[options])

调用 date picker

参数

  • options {Object}:调用 date picker 选项,更多选项可查看Pickday Configuration

    • value {string}:必选,date picker 选中的值,date 的字符串格式为yyyy-MM-dd
    • max {string}:可选,date 的最大值
    • min {string}:可选,date 的最小值
  • callback {function (ret)}:执行完读取操作后的回调函数。ret {Object}callback 函数的参数,有两个属性:

    • result {string}:结果三种类型 success, cancel, error
    • data {string}:选择的值 date 的字符,格式为 yyyy-MM-dd, 仅成功确认的时候存在。

pickTime(options, callback[options])

调用 time picker

参数

  • options {Object}:调用 time picker 选项

    • value {string}:必选,time 格式为 HH:mm
  • callback {function (ret)}:执行完读取操作后的回调函数。ret {Object}callback 函数的参数,有两个属性:

    • result {string}:结果三种类型 success, cancel, error

    • data {string}:time 格式为 HH:mm, 仅成功确认的时候存在。