From 66d2c8d8c97e19fdbd969f97dd3d6a28f27c415f Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Wed, 01 Nov 2023 16:07:03 +0800 Subject: [PATCH] fix:小程序分享功能和秒级数据 --- 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