jinzhe / vue-calendar Goto Github PK
View Code? Open in Web Editor NEWA calendar components for Vue.js.
Home Page: http://jinzhe.github.io/vue-calendar/
License: MIT License
A calendar components for Vue.js.
Home Page: http://jinzhe.github.io/vue-calendar/
License: MIT License
日历用于签到。
@jinzhe
复现步骤: 选择日期如2016年10月31日 然后切换至其他月份日期如11月11日 console中报错Uncaught TypeError: Cannot read property '0' of undefined(…)
经简单测试 有10月31日 10月30日 7月31日 7月30日等日期会报错
livedemo亦可复现
比如翻了很多页之后,想点击一个按钮直接回到当前日期所在的日历页面。
支不支持一次出现多个月的?支不支持一次出现多个月的?
就是显示天的td竟然是空白的
我想在本地重现 gif 效果,但始终跑不起来。希望能给予指导或更详细的 demo
本地可以预览了,但出现样式问题。
calendar.vue
Line 84:
lastDayOfLastMonth = m == 0 ? new Date(y - 1, 11, 0).getDate() : new Date(y, m, 0).getDate();//最后一月的最后一天
实际上这样就可以了
var lastDayOfLastMonth = new Date(y, m, 0).getDate();
你好,请问可以获取点击的日期的是周几吗?
可以的话,能不能返回这个值?
或者,作者提供一个思路,谢谢!
调试了一下是6603行报错,好像是requestAnimationFrame
调用的问题。
我是直接clone https://github.com/jinzhe/vue-calendar.git
然后npm install 再 npm run dev
莫名奇妙的报一大堆错
时分秒的限制条件有问题
我想切换月份或者年份时,请求对应月份的数据。
选择完一个月份的天数之后到另外一个月份选择天数的时候,每点击一下都会跳转到第一次选择的月份
老铁们, 你们都是怎么用的 啊, 我是把calendar.js, 和calendar.vue copy 到项目里去了, 再把 calendar 引入到我要用的地方 然后 他就报template or render function not defined , 请问 我这样用 有毛病 吗 ? 在线等......
场景:根据我客户的年龄实际情况,录入出生日期时,我只想下面的出生日期出现在1992年附近的,但是这是非必填项,当不填时还应该是空。这样给value初始值时也不满足要求了
插件是否做了兼容,能在移动端使用?
如题
目前只能支持一个输入框,怎么支持多个输入框?
现在的输入是0-99都可以,有办法限制这个时间只是一天24小时么?
import VueCalendar from 'vue-calendar' Vue.use(VueCalendar);
这样把插件引用进来会报错,还有你的demo里面按组件的方式引入在vue2.0会不兼容,求大神指点
export default { components:{ calendar },
display 如何动态的设置时间
如題
Please translate the docs / README.md to English.
Tks
请问 是否有 时间选择 选项
是显示层级问题吗? 你检查下啊
先谢谢大神啦~ 组件功能很强大了,但是如果跨月的话,月份天数不一样,怎么返回我选择的日期的总天数啊?
父组件如何异步获取的数据更新calendar组件的events属性
如题,在pc端没有问题,但移动端不行
设置开始时间跟结束时间 假如我开始时间是5号 但是结束时间能选择当天的时间
使用的是Vue1.x还是2?
我们系统是开发教务系统的,日期需要可以任意选择,不知大神可否加这个功能
能在多选 event 事件里 区分 周六日 节假日 平常日么
分别设置不同的价格
vue-calendar $ npm run dev
[email protected] dev /Users/lixia/Desktop/vue-calendar
node build/dev-server.js
Starting dev server...
events.js:160
throw er; // Unhandled 'error' event
^
Error: listen EACCES 0.0.0.0:666
at Object.exports._errnoException (util.js:1026:11)
at exports._exceptionWithHostPort (util.js:1049:20)
at Server._listen2 (net.js:1244:19)
at listen (net.js:1293:10)
at Server.listen (net.js:1389:5)
at EventEmitter.listen (/Users/lixia/Desktop/vue-calendar/node_modules/express/lib/application.js:618:24)
at Object. (/Users/lixia/Desktop/vue-calendar/build/dev-server.js:82:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] dev: node build/dev-server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script 'node build/dev-server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the vue-calendar package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs vue-calendar
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls vue-calendar
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/lixia/Desktop/vue-calendar/npm-debug.log
这个错误不影响正常适用,但是挺让人忧伤的。。。
[Vue warn]: Prop "sep" expects a two-way binding type. (found in component: <calendar>)
<input class="calendar-input" size="20" id="createDate" type="text" @click.stop="openCalendar($event,'picker2')" v-model="calendar.items.picker2.value" placeholder="选择时间">
<calendar
:show.sync="calendar.show"
:type="calendar.type"
:value.sync="calendar.value"
:x="calendar.x"
:y="calendar.y"
:begin.sync="calendar.begin"
:end.sync="calendar.end"
:range.sync="calendar.range"
:weeks="calendar.weeks"
:months="calendar.months"
:sep="calendar.sep">
</calendar>
<script type="text/ecmascript-6">
import calendar from '../../../dashborader/calendar/calendar';
export default{
data() {
calendar:{
show:false,
x:0,
y:0,
picker:"",
type:"date",
value:"",
begin:"",
end:"",
value:"",
sep:"/",
weeks:[],
months:[],
range:false,
items:{
// 2个日期模式
picker2:{
type:"date",
value:"",
range:true,
sep:"-"
}
}
},
watch:{
'calendar.value': function (value) {
this.calendar.items[this.calendar.picker].value=value
}
},
methods: {
// 打开显示选择器
openCalendar(e,type) {
// 设置类型
this.calendar.picker=type
this.calendar.type=this.calendar.items[type].type
this.calendar.range=this.calendar.items[type].range
this.calendar.begin=this.calendar.items[type].begin
this.calendar.end=this.calendar.items[type].end
this.calendar.value=this.calendar.items[type].value
// 可不用写
this.calendar.sep=this.calendar.items[type].sep
this.calendar.weeks=this.calendar.items[type].weeks
this.calendar.months=this.calendar.items[type].months
this.calendar.show=true
this.calendar.x=e.target.offsetLeft
this.calendar.y=e.target.offsetTop+e.target.offsetHeight+8
}
},
components: {
calendar
}
}
}
</script>
如题
移动端 能否加入滑屏切换日期月份。
我觉得你应该在 style 加上 scoped 来保证样式是内链的,这样子不会被class这些覆盖。
项目种种原因,需要使用传统多页面,但是直接 <script> 引入Vue,现在看到您的日历控件非常棒,想要使用,但是不知如何直接 <script> 引入?
目前日期控件使用完美,但产品方面提出,在当前月可以选择临近月份的时间,而不是只能选择当前月,不知是否有属性可以做到?
if i was in September, i cannot pick the date of August, only if i change the month to August.So my question is can i pick date over the month, not disable the other month's date
我想每页只显示当月的时间,应该在那里设置?
// 获取自定义事件
getEvents(y,m,d){
if(d<10){d = '0'+d}
if(m<10){m = '0'+m}
if(Object.keys(this.events).length==0)return false;
if(this.events[y+"-"+m+"-"+d]!=undefined){
return {
eventName:this.events[y+"-"+m+"-"+d]
}
}
return {}
},
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.