fanghuisheng vor 1 Jahr
Ursprung
Commit
ad20a4707e

+ 2 - 84
src/uni_modules/uview-plus/changelog.md

@@ -1,87 +1,5 @@
-## 3.1.28(2023-03-03)
-修复u-tabs标签缺失
-## 3.1.27(2023-02-28)
-修复日历组建对dayjs等依赖
-## 3.1.26(2023-02-04)
-修复安卓Multiple conflicting contents for sourcemap
-## 3.1.25(2023-02-04)
-修复dayjs引入问题导致小程序编译报错
-## 3.1.24(2023-01-17)
-修复dayjs报错does not provide an export named 'default'
-## 3.1.23(2023-01-15)
-修复 build:h5 cell 和 notice-bar 点击失效的问题 
-修复小程序端报 alert 和 upload 重复定义的bug
-感谢@dodu2014
-## 3.1.22(2023-01-14)
-增加transpileDependencies检测
-## 3.1.21(2023-01-14)
-修复路由配置合并问题
-## 3.1.20(2022-12-16)
-修复拼写
-## 3.1.19(2022-11-16)
-修复u-rate的v-model绑定值不生效#48
-修复u-grid-item click事件会执行两次 #40
-修复u--input组建Property "value" was accessed during render but is not defined on instance
-修复textarea组建confirmType报错
-## 3.1.18(2022-10-23)
-新增页面模板
-## 3.1.17(2022-10-23)
-演示项目增加国家化支持及多个页面模板
-## 3.1.16(2022-10-21)
-修复u-switch、u-picker等
-## 3.1.15(2022-10-13)
-修复:数据更新后,上传组件的视图没有更新
-复选框 超出不换行
-单选框 超出不换行
-## 3.1.14(2022-10-11)
-swipe-action-item组件增加emits定义
-## 3.1.13(2022-09-19)
-修复富文本解析
-## 3.1.12(2022-09-15)
-check-box组件清空数组时无法更新视图的问题
-## 3.1.11(2022-09-14)
-修复u-checkbox-group等
-## 3.1.10(2022-09-14)
-修复u-checkbox-box双向绑定
-## 3.1.9(2022-09-08)
-紧急修复缺失endif
-## 3.1.8(2022-09-07)
-修复u-checkbox-group双向绑定
-修复picker缺少emits定义
-## 3.1.7(2022-08-28)
-修复布局在微信小程序失效
-## 3.1.6(2022-08-25)
-修复微信小程序下tabbar样式问题
-## 3.1.5(2022-08-24)
-修复icon/text/tabs点击事件执行两次
-## 3.1.4(2022-08-20)
-修复button组件点击事件执行两次
-## 3.1.3(2022-08-11)
-修复小程序报错Generated an empty chunk,修复示例工程引入request参数配置无效。
-## 3.1.2(2022-08-09)
-修复示例项目对request的调用引入
-## 3.1.1(2022-08-07)
-折叠面板在小程序会报'setContentAnimate' of undefined
-## 3.1.0(2022-08-07)
-初步解决App端运行时提示props未定义且白屏问题
-## 3.0.17(2022-08-03)
-修复u-image组件报borderRadius警告
-## 3.0.16(2022-07-30)
-修复方法重复,属性重复等多个编译到APP时的warning
-## 3.0.15(2022-07-22)
-修复支付宝下不支持this.$slots导致cell的slot失效
-## 3.0.14(2022-07-22)
-修复u-grid-item与u-swipe-action-item在支付宝编译报错问题
-## 3.0.13(2022-07-22)
-修复u--input与u--textarea组件多个事件执行两次问题
-## 3.0.12(2022-07-20)
-修复u-action-sheet中v-for报错
-u-collapse-item中slot修复
-## 3.0.11(2022-07-19)
-修复微信小程序编译报错及其它修复
-## 3.0.10(2022-07-15)
-修复文档一批slot示例写法
-修复u-search缺失emits定义导致warning
+## 3.1.31(2023-05-15)
+本地累计修复一些问题提交
 ## 3.0.9(2022-07-14)
 修复u-search双向绑定
 ## 3.0.8(2022-07-12)

+ 1 - 1
src/uni_modules/uview-plus/components/u-back-top/u-back-top.vue

@@ -51,7 +51,7 @@
 	 */
 	export default {
 		name: 'u-back-top',
-		mixins: [uni.$u.mpMixin, uni.$u.mixin,props],
+		mixins: [mpMixin, mixin,props],
 		computed: {
 			backTopStyle() {
 				// 动画组件样式

+ 2 - 2
src/uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.vue

@@ -98,7 +98,7 @@
 			this.init()
 		},
 		// #ifdef VUE3
-		emits: ['close', 'cancel', 'confirm', 'change'],
+		emits: ['close', 'cancel', 'confirm', 'change', 'update:modelValue'],
 		// #endif
 		methods: {
 			init() {
@@ -188,7 +188,7 @@
 				// 发出change时间,value为当前选中的时间戳
 				this.$emit('change', {
 					value: selectValue,
-					// #ifndef MP-WEIXIN
+					// #ifndef MP-WEIXIN || MP-TOUTIAO
 					// 微信小程序不能传递this实例,会因为循环引用而报错
 					picker: this.$refs.picker,
 					// #endif

+ 2 - 2
src/uni_modules/uview-plus/components/u-picker/u-picker.vue

@@ -164,7 +164,7 @@ export default {
 			this.setIndexs(value)
 
 			this.$emit('change', {
-				// #ifndef MP-WEIXIN || MP-LARK
+				// #ifndef MP-WEIXIN || MP-LARK || MP-TOUTIAO
 				// 微信小程序不能传递this,会因为循环引用而报错
 				picker: this,
 				// #endif
@@ -214,7 +214,7 @@ export default {
 		},
 		// 设置整体各列的columns的值
 		setColumns(columns) {
-			// console.log(columns)
+			console.log(columns)
 			this.innerColumns = uni.$u.deepClone(columns)
 			// 如果在设置各列数据时,没有被设置默认的各列索引defaultIndex,那么用0去填充它,数组长度为列的数量
 			if (this.innerIndex.length === 0) {

+ 22 - 21
src/uni_modules/uview-plus/components/u-tabs/u-tabs.vue

@@ -49,29 +49,30 @@
 							class="u-tabs__wrapper__nav__line"
 							ref="u-tabs__wrapper__nav__line"
 							:style="[{
-									width: $u.addUnit(lineWidth),
-									height: $u.addUnit(lineHeight),
-									background: lineColor,
-									backgroundSize: lineBgSize,
-								}]"
+								width: $u.addUnit(lineWidth),
+								height: $u.addUnit(lineHeight),
+								background: lineColor,
+								backgroundSize: lineBgSize,
+							}]"
 						>
-							<!-- #endif -->
-							<!-- #ifndef APP-NVUE -->
-							<view
-								class="u-tabs__wrapper__nav__line"
-								ref="u-tabs__wrapper__nav__line"
-								:style="[{
-										width: $u.addUnit(lineWidth),
-										transform: `translate(${lineOffsetLeft}px)`,
-										transitionDuration: `${firstTime ? 0 : duration}ms`,
-										height: $u.addUnit(lineHeight),
-										background: lineColor,
-										backgroundSize: lineBgSize,
-									}]"
-							>
-								<!-- #endif -->
-							</view>
 						</view>
+						<!-- #endif -->
+						<!-- #ifndef APP-NVUE -->
+						<view
+							class="u-tabs__wrapper__nav__line"
+							ref="u-tabs__wrapper__nav__line"
+							:style="[{
+								width: $u.addUnit(lineWidth),
+								transform: `translate(${lineOffsetLeft}px)`,
+								transitionDuration: `${firstTime ? 0 : duration}ms`,
+								height: $u.addUnit(lineHeight),
+								background: lineColor,
+								backgroundSize: lineBgSize,
+							}]"
+						>
+						</view>
+						<!-- #endif -->
+					</view>
 				</scroll-view>
 			</view>
 			<slot name="right" />

+ 32 - 0
src/uni_modules/uview-plus/components/u-timeline/props.js

@@ -0,0 +1,32 @@
+import defprops from '../../libs/config/props';
+export default {
+    props: {
+        // 是否显示
+        show: {
+            type: Boolean,
+            default: defprops.drawer.show
+        },
+        // 点击遮罩是否关闭
+        mask: {
+            type: Boolean,
+            default: defprops.drawer.mask
+        },
+        // 抽屉宽度
+        width: {
+            type: [String, Number],
+            default: defprops.drawer.width 
+        },
+        // 抽屉位置
+        placement: {
+            type: String,
+            default: defprops.drawer.placement
+        },
+        // 权重
+        zIndex: {
+            type: Number,
+            default: defprops.drawer.zIndex
+        },
+
+
+      }
+    }

+ 129 - 0
src/uni_modules/uview-plus/components/u-timeline/u-drawer.vue

@@ -0,0 +1,129 @@
+
+<template>
+  <view  v-show="visible">
+    <view
+      class="u-drawer__overlay"
+      :style="{ zIndex: zIndex }"
+      @click.stop="handleOverlayClick"
+    >
+    </view>
+    <view
+      class="u-drawer"
+      :class="{
+        'u-drawer--left': placement === 'left',
+        'u-drawer--right': placement === 'right'
+      }"
+      :style="{ zIndex: zIndex + 1, width: width, [placement]: `-${translate}` }"
+      @transitionend="handleTransitionEnd"
+    >
+      <view class="u-drawer__content">
+        <slot></slot>
+      </view>
+    </view>
+  </view>
+</template>
+<script>
+import props from './props.js'
+export default {
+  name: 'u-drawer',
+  mixins: [props],
+  // props: {
+  //   // 
+  //   visible: {
+  //     type: Boolean,
+  //     default: false,
+  //   },
+  //   mask: {
+  //     type: Boolean,
+  //     default: true,
+  //   },
+  //   width: {
+  //     type: Number,
+  //     default: 300,
+  //   },
+  //   placement: {
+  //     type: String,
+  //     default: 'left',
+  //     validator: (value) => ['left', 'right'].includes(value),
+  //   },
+  //   // transition: {
+  //   //   type: String,
+  //   //   default: 'u-slide-down',
+  //   // },
+  //   zIndex: {
+  //     type: Number,
+  //     default: 100,
+  //   },
+  // },
+  data() {
+    return {
+      translate: 0,
+    };
+  },
+  watch: {
+    show: {
+      immediate: true,
+      handler(value) {
+        if (value) {
+          this.openDrawer();
+        } else {
+          this.closeDrawer();
+        }
+      },
+    },
+  },
+  methods: {
+    openDrawer() {
+      this.$emit('open');
+      this.translate = this.width;
+    },
+    closeDrawer() {
+      this.$emit('close');
+      this.translate = 0;
+    },
+    handleOverlayClick() {
+      // console.log('this.mask',this.mask)
+      if (this.mask) {
+        this.$emit('update:visible', false);
+      }
+    },
+    handleTransitionEnd() {
+      if (!this.visible) {
+        this.translate = 0;
+      }
+    },
+  },
+};
+</script>
+<style scoped>
+.u-drawer {
+  position: fixed;
+  top: 0;
+  bottom: 0;
+  background-color: #fff;
+  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
+  overflow: hidden;
+}
+
+.u-drawer--left {
+  left: 0;
+}
+
+.u-drawer--right {
+  right: 0;
+}
+
+.u-drawer__content {
+  height: 100%;
+  overflow-y: auto;
+}
+
+.u-drawer__overlay {
+  position: fixed;
+  top: 0;
+  left: 0;
+  bottom: 0;
+  right: 0;
+  background-color: rgba(0, 0, 0, 0.5);
+}
+</style>

+ 3 - 1
src/uni_modules/uview-plus/libs/config/props.js

@@ -93,6 +93,7 @@ import Toolbar from './props/toolbar'
 import Tooltip from './props/tooltip'
 import Transition from './props/transition'
 import Upload from './props/upload'
+import drawer from './props/drawer'
 
 const {
     color
@@ -186,5 +187,6 @@ export default {
     ...Toolbar,
     ...Tooltip,
     ...Transition,
-    ...Upload
+    ...Upload,
+    ...drawer,
 }

+ 17 - 0
src/uni_modules/uview-plus/libs/config/props/drawer.js

@@ -0,0 +1,17 @@
+export default {
+  // 抽屉组件
+  drawer:{
+    // 是否显示 
+    show:false,
+    // 点击遮罩是否关闭
+    mask:true,
+    // // 是否显示关闭按钮
+    // closeBtn:true,
+    // 抽屉宽度
+    width:'40%',
+    // 抽屉位置
+    placement:'left',
+    // 权重
+    zIndex: 100,
+  }
+}

+ 1 - 1
src/uni_modules/uview-plus/package.json

@@ -2,7 +2,7 @@
 	"id": "uview-plus",
 	"name": "uview-plus",
 	"displayName": "uview-plus3.0重磅发布,全面的Vue3移动组件库。",
-	"version": "3.1.28",
+	"version": "3.1.31",
 	"description": "uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
 	"keywords": [
         "uview",