From da25434b85fc5b4321c429bf95e719d00ec395bb Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Thu, 11 Jan 2024 16:21:16 +0800
Subject: [PATCH] 定位优化
---
uni_modules/uview-ui/components/u-transition/u-transition.vue | 92 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 92 insertions(+), 0 deletions(-)
diff --git a/uni_modules/uview-ui/components/u-transition/u-transition.vue b/uni_modules/uview-ui/components/u-transition/u-transition.vue
new file mode 100644
index 0000000..22831dc
--- /dev/null
+++ b/uni_modules/uview-ui/components/u-transition/u-transition.vue
@@ -0,0 +1,92 @@
+<template>
+ <view
+ v-if="inited"
+ class="u-transition"
+ ref="u-transition"
+ @tap="clickHandler"
+ :class="classes"
+ :style="[mergeStyle]"
+ @touchmove="noop"
+ >
+ <slot />
+ </view>
+</template>
+
+<script>
+import props from './props.js';
+// ���������methods���������������������������������������������������������mixin������
+import transition from "./transition.js";
+/**
+ * transition ������������
+ * @description
+ * @tutorial
+ * @property {String} show ������������������ ��������� false ���
+ * @property {String} mode ��������������������� ��������� 'fade' ���
+ * @property {String | Number} duration ������������������������������ms ��������� '300' ���
+ * @property {String} timingFunction ��������������������������� ��������� 'ease-out' ���
+ * @property {Object} customStyle ���������������
+ * @event {Function} before-enter ���������������
+ * @event {Function} enter ���������������
+ * @event {Function} after-enter ���������������
+ * @event {Function} before-leave ���������������
+ * @event {Function} leave ���������������
+ * @event {Function} after-leave ���������������
+ * @example
+ */
+export default {
+ name: 'u-transition',
+ data() {
+ return {
+ inited: false, // ������������/������������
+ viewStyle: {}, // ���������������������
+ status: '', // ���������������������������
+ transitionEnded: false, // ���������������������������
+ display: false, // ������������������
+ classes: '', // ���������������
+ }
+ },
+ computed: {
+ mergeStyle() {
+ const { viewStyle, customStyle } = this
+ return {
+ // #ifndef APP-NVUE
+ transitionDuration: `${this.duration}ms`,
+ // display: `${this.display ? '' : 'none'}`,
+ transitionTimingFunction: this.timingFunction,
+ // #endif
+ // ���������������������������������������������������������viewStyle������
+ ...uni.$u.addStyle(customStyle),
+ ...viewStyle
+ }
+ }
+ },
+ // ���mixin���������������������uni.$u.mixin������������������vue������������
+ mixins: [uni.$u.mpMixin, uni.$u.mixin, transition, props],
+ watch: {
+ show: {
+ handler(newVal) {
+ // vue���nvue���������������������������
+ // #ifdef APP-NVUE
+ newVal ? this.nvueEnter() : this.nvueLeave()
+ // #endif
+ // #ifndef APP-NVUE
+ newVal ? this.vueEnter() : this.vueLeave()
+ // #endif
+ },
+ // ���������������������������������props���show���������
+ immediate: true
+ }
+ }
+}
+</script>
+
+<style lang="scss" scoped>
+@import '../../libs/css/components.scss';
+
+/* #ifndef APP-NVUE */
+// vue������������������������������������������������
+@import './vue.ani-style.scss';
+/* #endif */
+
+.u-transition {}
+</style>
--
Gitblit v1.8.0