From 92230c9a97dc9ce9df3313d11d26999c04bb6b26 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期二, 15 七月 2025 13:12:48 +0800 Subject: [PATCH] 项目初始化 --- src/uni_modules/uni-calendar/readme.md | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 103 insertions(+), 0 deletions(-) diff --git a/src/uni_modules/uni-calendar/readme.md b/src/uni_modules/uni-calendar/readme.md new file mode 100644 index 0000000..4f3ca0e --- /dev/null +++ b/src/uni_modules/uni-calendar/readme.md @@ -0,0 +1,103 @@ + + +## Calendar 鏃ュ巻 +> **缁勪欢鍚嶏細uni-calendar** +> 浠g爜鍧楋細 `uCalendar` + + +鏃ュ巻缁勪欢 + +> **娉ㄦ剰浜嬮」** +> 涓轰簡閬垮厤閿欒浣跨敤锛岀粰澶у甯︽潵涓嶅ソ鐨勫紑鍙戜綋楠岋紝璇峰湪浣跨敤缁勪欢鍓嶄粩缁嗛槄璇讳笅闈㈢殑娉ㄦ剰浜嬮」锛屽彲浠ュ府浣犻伩鍏嶄竴浜涢敊璇�� +> - 鏈粍浠跺啘鍘嗚浆鎹娇鐢ㄧ殑js鏄� [@1900-2100鍖洪棿鍐呯殑鍏巻銆佸啘鍘嗕簰杞琞(https://github.com/jjonline/calendar.js) +> - 浠呮敮鎸佽嚜瀹氫箟缁勪欢妯″紡 +> - `date`灞炴�т紶鍏ョ殑搴旇鏄竴涓� String 锛屽锛� 2019-06-27 锛岃�屼笉鏄� new Date() +> - 閫氳繃 `insert` 灞炴�ф潵纭畾褰撳墠鐨勪簨浠舵槸 @change 杩樻槸 @confirm 銆傜悊搴斿悎骞朵负涓�涓簨浠讹紝浣嗘槸涓轰簡鍖哄垎妯″紡锛岀幇浣跨敤涓や釜浜嬩欢锛岃繖閲岄渶瑕佹敞鎰� +> - 寮圭獥妯″紡涓嬫棤娉曢樆姝㈠悗闈㈢殑鍏冪礌婊氬姩锛屽鏈夐渶瑕侀樆姝紝璇峰湪寮圭獥寮瑰嚭鍚庯紝鎵嬪姩璁剧疆婊氬姩鍏冪礌涓轰笉鍙粴鍔� + + +### 瀹夎鏂瑰紡 + +鏈粍浠剁鍚圼easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)瑙勮寖锛宍HBuilderX 2.5.5`璧凤紝鍙渶灏嗘湰缁勪欢瀵煎叆椤圭洰锛屽湪椤甸潰`template`涓嵆鍙洿鎺ヤ娇鐢紝鏃犻渶鍦ㄩ〉闈腑`import`鍜屾敞鍐宍components`銆� + +濡傞渶閫氳繃`npm`鏂瑰紡浣跨敤`uni-ui`缁勪欢锛屽彟瑙佹枃妗o細[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) + +### 鍩烘湰鐢ㄦ硶 + +鍦� ``template`` 涓娇鐢ㄧ粍浠� + +```html +<view> + <uni-calendar + :insert="true" + :lunar="true" + :start-date="'2019-3-2'" + :end-date="'2019-5-20'" + @change="change" + /> +</view> +``` + +### 閫氳繃鏂规硶鎵撳紑鏃ュ巻 + +闇�瑕佽缃� `insert` 涓� `false` + +```html +<view> + <uni-calendar + ref="calendar" + :insert="false" + @confirm="confirm" + /> + <button @click="open">鎵撳紑鏃ュ巻</button> +</view> +``` + +```javascript + +export default { + data() { + return {}; + }, + methods: { + open(){ + this.$refs.calendar.open(); + }, + confirm(e) { + console.log(e); + } + } +}; + +``` + + +## API + +### Calendar Props + +| 灞炴�у悕 | 绫诲瀷 | 榛樿鍊紎 璇存槑 | +| | | +| date | String |- | 鑷畾涔夊綋鍓嶆椂闂达紝榛樿涓轰粖澶� | +| lunar | Boolean | false | 鏄剧ず鍐滃巻 | +| startDate | String |- | 鏃ユ湡閫夋嫨鑼冨洿-寮�濮嬫棩鏈� | +| endDate | String |- | 鏃ユ湡閫夋嫨鑼冨洿-缁撴潫鏃ユ湡 | +| range | Boolean | false | 鑼冨洿閫夋嫨 | +| insert | Boolean | false | 鎻掑叆妯″紡,鍙�夊�硷紝ture锛氭彃鍏ユā寮忥紱false锛氬脊绐楁ā寮忥紱榛樿涓烘彃鍏ユā寮� | +|clearDate |Boolean |true |寮圭獥妯″紡鏄惁娓呯┖涓婃閫夋嫨鍐呭 | +| selected | Array |- | 鎵撶偣锛屾湡寰呮牸寮廩{date: '2019-06-27', info: '绛惧埌', data: { custom: '鑷畾涔変俊鎭�', name: '鑷畾涔夋秷鎭ご',xxx:xxx... }}] | +|showMonth | Boolean | true | 鏄惁鏄剧ず鏈堜唤涓鸿儗鏅� | + +### Calendar Events + +| 浜嬩欢鍚� | 璇存槑 |杩斿洖鍊紎 +| | | | +| open | 寮瑰嚭鏃ュ巻缁勪欢锛宍insert :false` 鏃剁敓鏁坾- | + + + + + +## 缁勪欢绀轰緥 + +鐐瑰嚮鏌ョ湅锛歔https://hellouniapp.dcloud.net.cn/pages/extUI/calendar/calendar](https://hellouniapp.dcloud.net.cn/pages/extUI/calendar/calendar) \ No newline at end of file -- Gitblit v1.9.3