Explorar o código

feat: 解决冲突

huangzhichao hai 1 ano
pai
achega
799bcab15f

+ 2 - 0
.gitignore

@@ -222,3 +222,5 @@ FakesAssemblies/
 **/*.Server/ModelManifest.xml
 _Pvt_Extensions
 
+.DS_Store
+

+ 3 - 1
package.json

@@ -38,7 +38,9 @@
     "@tarojs/taro": "3.6.19",
     "crypto-js": "^3.1.9-1",
     "react": "^18.0.0",
-    "react-dom": "^18.0.0"
+    "react-dom": "^18.0.0",
+    "taro-calendar-customizable": "^2.1.2",
+    "taro-ui": "^3.3.0"
   },
   "devDependencies": {
     "@babel/core": "^7.8.0",

+ 0 - 0
src/pages/components/demo/index.config.ts


+ 0 - 15
src/pages/components/demo/index.tsx

@@ -1,15 +0,0 @@
-import { View } from "@tarojs/components"
-import React from 'react'
- 
-const Demo: React.FC = (props) => {
-  function demoClick() {
-    console.log(props)
-  }
-
-
-  return (
-    <View onClick={demoClick}>123</View>
-  )
-}
-
-export default Demo

+ 1 - 1
src/pages/index/index.config.ts

@@ -3,6 +3,6 @@ export default {
   navigationStyle: 'default',
   usingComponents: {
     'custom': 'plugin://myPlugin/custom',
-    'calendar': 'plugin://myPlugin/calendar'
+    'calendar': 'plugin://myPlugin/calendar-ui'
   }
 }

+ 0 - 2
src/pages/index/index.less

@@ -1,6 +1,4 @@
 .index {
   width: 100vw;
   height: 100vh;
-  display: flex;
-  justify-content: center;
 }

+ 0 - 0
src/plugin/components/calendar/index.less


+ 1 - 0
src/plugin/components/calendar/index.scss

@@ -0,0 +1 @@
+@import "~taro-ui/dist/style/components/calendar.scss";

+ 8 - 4
src/plugin/components/calendar/index.tsx

@@ -1,9 +1,13 @@
-import { View } from "@tarojs/components"
+import { View } from '@tarojs/components'
+import { AtCalendar } from "taro-ui"
+import './index.scss'
 
-function Calendar() {
+function Index() {
   return (
-    <View></View>
+    <View>
+      <AtCalendar />
+    </View>
   )
 }
 
-export default Calendar
+export default Index

+ 23 - 5
src/plugin/doc/README.md

@@ -1,9 +1,27 @@
-# 老好看插件文档
+## 使用插件
+在使用插件前,首先要在小程序管理后台的“设置-第三方服务-插件管理”中添加插件。
+开发者可登录小程序管理后台,通过 wx5ef216d1caf4a0ea 查找插件并添加。
 
-## 二级标题
 
-### 三级标题
+## 引入插件
+1. 在 app.json 中声明
+```
+{
+  "plugins": {
+    "calendar-ui": {
+      "version": "1.0.1",
+      "provider": "wx5ef216d1caf4a0ea"
+    }
+  }
+}
+```
+2. 在 page.json 中入用组件
 
-这个文件用于书写插件文档,引用图片时必须以**相对路径**引用 ***doc*** 目录下的本地图片,不能使用网络图片或非 ***doc*** 目录下的图片。以下是相对路径的引用示例:
+```
+{
+  "usingComponents": {
+    "calendar": "plugin://calendar-ui/calendar-ui"
+  }
+}
+```
 
-使用编辑器下方的上传按钮可以上传插件文档,上传的内容包括 doc 目录下的 README.md 和图片。

+ 1 - 1
src/plugin/plugin.json

@@ -1,7 +1,7 @@
 {
   "publicComponents": {
     "custom": "components/custom/index",
-    "calendar": "components/calendar/index"
+    "calendar-ui": "components/calendar/index"
   },
   "pages": {
   },