Vue2一个漂亮的日期选择组件:
仅依赖于Vue
轻量级(小于4kb的压缩包)
美观
使用安装$ npm install vue-datepicker-localES6<template> <vue-datepicker-local v-model="time" /></template><script>import VueDatepickerLocal from 'vue-datepicker-local'export default { components: { VueDatepickerLocal }, data () { return { time: new Date() } }}</script>浏览器全局dist文件夹包含了vue-datepicker-local.js和vue-datepicker-local.css。
<!DOCTYPE html><html><head> <link rel="stylesheet" href="path/to/vue-datepicker-local.css"></head><body> <div id="app"> <vue-datepicker-local v-model="time"></vue-datepicker-local> </div> <script src="path/to/vue.js"></script> <script src="path/to/vue-datepicker-local.js"></script> <script> new Vue({ el: "#app", data: { time: new Date() } }) </script></body></html>
评论