vue2.0 Project Calendar.js (Calendar component encapsulation)

Source: Internet
Author: User
Tags git clone

Recently has been idle to do nothing, then think about doing their own personal projects, also want to say can use now more popular of some MVVM framework to do, so choose a technology stack vue2.0+vue-router+vuex+webpack to do, do is also multi-page application, Using Vue-router, it is also wanted to say that the multi-function modular, single-module spa, achieve higher results. Of course now still in the process of doing, if interested can come over star, haha, https://github.com/xiaobinwu/Wuji,git clone down to see.

Today is to say in the process of doing this project, I want to add a calendar function, but find a lot of plug-ins, not much is my mind, so I want to say that they write one, but the imagination is too good, technical ability is not enough, can not write, here omit 10,000 words. Finally find the Baidu calendar is quite in line with the calendar I want to function, but I want to more self-tuning better, so take this to do a bit of modification. The result looks like this:

Assign the last calendar component to a global variable, exposing the method in module mode to configure the calendar:

    <DivID= "cal">        <DivID= "Top">            <Divclass= "Select">                <SelectID= "Year-select"></Select>&nbsp;years<SelectID= "Month-select"></Select>&nbsp;Month</Div>            <Divclass= "Step">                <spanID= "Prev"><</span>                <spanID= "Next">></span>                                           </Div>        </Div>        <ulID= "wk">            <Li>One</Li>            <Li>Two</Li>            <Li>Three</Li>            <Li>Four</Li>            <Li>Five</Li>            <Li><b>Six</b></Li>            <Li><b>Day</b></Li>        </ul>        <DivID= "cm"></Div>        <DivID= "BM">            <Divclass= "Heavenly-branch">                <spanID= "Heavenly"></span>Years&nbsp;[<spanID= "Branch"></span>]</Div>            <ahref= "javascript:;;"ID= "Now-date">Back to today</a>        </Div>    </Div>

Js:

    calendar.init ({        function(cell, datedata) {            console.log (datedata);            Alert (' you clicked on ' + datedata.solaryear + ' + ' + ' + datedata.solarmonth + ' month ' + datedata.solardate + ' Day ');}    } );

So the source code to make some comments, in order to modify later, you can go to see the detailed code: https://github.com/xiaobinwu/calendar.js

vue2.0 Project Calendar.js (Calendar component encapsulation)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.