Coder Social home page Coder Social logo

panwenhua / vue-calendar-list-view Goto Github PK

View Code? Open in Web Editor NEW
25.0 3.0 9.0 25.96 MB

基于vue的移动端日历列表组件,可用于旅游网站的出行日期选择。

Home Page: https://panwenhua.github.io/vue-calendar-list-view/

HTML 3.53% JavaScript 4.67% Vue 64.46% CSS 27.33%
calendar vue vue-calendarlistview calendarlist mobile clendarmobile calendarlistview listview vue-cli3 npm

vue-calendar-list-view's Introduction

vue-calendar-list-view

一个日历列表组件。

NPM version node version npm download Build Status

install

vue-calendar-list-view

Development

npm install
npm serve

Example

http://localhost:8000/

online example: https://panwenhua.github.io/vue-calendar-list-view/

Usage

import 'vue-calendar-list-view'
import 'vue-calendar-list-view/lib/calendarListView.css'


<template>
	<CalendarList :aroud="calendar.aroud" :on-select="onSelect" :options="calendar.options" :value="currentDate"></CalendarList>
</template>
<script>
export default {
  data() {
    return {
      calendar: {
        aroud: 12, //12个月
        options: [
          {
            //对应日期的  人数
            date: "2018-11-11",
            label: "剩12人",
            value: 12
          },
          {
            date: "2018-11-12",
            label: "剩13人",
            value: 13
          },
          {
            date: "2018-11-13",
            label: "剩14人",
            value: 14
          },
          {
            date: "2018-11-14",
            label: "剩15人",
            value: 15
          },
          {
            date: "2018-11-20",
            label: "剩16人",
            value: 16
          }
        ]
      },
      currentDate: null //当前选择的日期
    };
  },
  methods: {
    onSelect(date, value, recode) {
      //date:当前选择的日期 
      //value:当前选择的数量
      //recode:当前选择的的对象
      console.log(date, value, recode);
      this.currentDate = date;
    }
  }
};
</script>
<style lang="scss" scoped>
</style>

API

Props

name type default description
aroud Number 12 渲染日历的区间,例如当前为2018年11月,则日历会渲染2018年11月到2019年10月的数据
value String 当前日历选中的值
options Object[]
name type default description
date String 日期。例如 "2018-11-14"
value String|Number 日期对应的数量。比如出行人数"14"
label String 对应数量的渲染label。比如"还剩14人"
onSelect Function(date,value,recode) 选择之后的回调。//date:当前选择的日期 //value:当前选择的数量 //recode:当前选择的的对象

License

vue-calendar-list-view is released under the MIT license.

vue-calendar-list-view's People

Contributors

dependabot[bot] avatar panwenhua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vue-calendar-list-view's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.