afap / xcx-plugins Goto Github PK
View Code? Open in Web Editor NEW小程序组件
小程序组件
是用placeholder吗?你只告诉是string,但是没说怎么用啊!
在页面的非第一屏引用时,样式出现问题
demo.wxml
<view>内容</view>
<!-- 其中内容超过一屏可显示范围 -->
<view>内容</view>
<calendar mode='pickerRange'/>
<view>少量内容,不足以填充calendar的高度时</view>
calendar的wxml中,下拉的日历view定位为fixed,在组件之后没有内容或内容过少,会出现下拉日历显示不全的问题
beginDate和endDate如果是直接写在data里是可以初始化的,但是动态获取setData的时候就不行了
我遇到的问题:澳大利亚时区下的2021年4月,显示有两个4日;定位到的问题
我的解决方案:
在components/calendar/index.js 文件
使用moment 的日期库
// let date = new Date(currenDate.getTime() + 86400000 * i);
let date = new Date(moment(currenDate.getTime()).add(i, 'days').valueOf())
而且进一步在 getMonthDayCount 方法获取 一个月的天数最好也是使用 moment
// return (d_next_month_first_day.getTime() - d_first_day.getTime()) / 86400000;
return moment(d_next_month_first_day.getTime()).diff(moment(d_first_day.getTime()), 'days')
日历上展示日期区间可以选择为黑色, 超出日期区间可以展示为灰色
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.