New Huajishe Check ChaoXing

This commit is contained in:
e2hang
2025-10-01 10:01:52 +08:00
parent 240b884eac
commit 80be8ae3cf
1094 changed files with 61709 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
:: BASE_DOC ::
## API
### Transition Props
name | type | default | description | required
-- | -- | -- | -- | --
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets)used to set style on virtual component | N
appear | Boolean | false | \- | N
destory-on-hide | Boolean | false | \- | N
durations | Number / Array | - | Typescript`number \| number[]` | N
name | String | t-transition | \- | N
visible | Boolean | false | \- | N

View File

@@ -0,0 +1,46 @@
---
title: Transition 过渡
description: 过渡组件。
spline: message
isComponent: true
---
## 引入
### 引入组件
`app.json``page.json` 中引入组件:
```json
"usingComponents": {
"t-transition": "tdesign-miniprogram/transition/transition"
}
```
## 用法
### 组件方式
```xml
<!-- page.wxml -->
<t-transition
name="transition-class"
visible="{{ visible }}"
>
<view class="block" style="width: 100px; height: 100px; background: red;"></view>
</t-transition>
```
## API
### Transition Props
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
appear | Boolean | false | 首次出现是否展示动画 | N
destory-on-hide | Boolean | false | 隐藏时是否销毁内容 | N
durations | Number / Array | - | 指定过渡时间。TS 类型:`number \| number[]` | N
name | String | t-transition | 过渡类名 | N
visible | Boolean | false | 是否显示 | N

View File

@@ -0,0 +1,2 @@
export * from './props';
export * from './type';

View File

@@ -0,0 +1,2 @@
export * from './props';
export * from './type';

View File

@@ -0,0 +1,3 @@
import { TdTransitionProps } from './type';
declare const props: TdTransitionProps;
export default props;

View File

@@ -0,0 +1,22 @@
const props = {
appear: {
type: Boolean,
value: false,
},
destoryOnHide: {
type: Boolean,
value: false,
},
durations: {
type: null,
},
name: {
type: String,
value: 't-transition',
},
visible: {
type: Boolean,
value: false,
},
};
export default props;

View File

@@ -0,0 +1,8 @@
import { SuperComponent } from '../common/src/index';
export default class Transition extends SuperComponent {
externalClasses: string[];
behaviors: string[];
data: {
classPrefix: string;
};
}

View File

@@ -0,0 +1,25 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { SuperComponent, wxComponent } from '../common/src/index';
import transition from '../mixins/transition';
import config from '../common/config';
const { prefix } = config;
const name = `${prefix}-transition`;
let Transition = class Transition extends SuperComponent {
constructor() {
super(...arguments);
this.externalClasses = [`${prefix}-class`];
this.behaviors = [transition()];
this.data = {
classPrefix: name,
};
}
};
Transition = __decorate([
wxComponent()
], Transition);
export default Transition;

View File

@@ -0,0 +1,5 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {}
}

View File

@@ -0,0 +1,9 @@
<wxs src="../common/utils.wxs" module="_" />
<view
class="class {{prefix}}-class {{classPrefix}} {{ transitionClass }}"
style="{{_._style([visible ? '' : 'display: none', style, customStyle])}}"
bind:transitionend="onTransitionEnd"
>
<slot />
</view>

View File

@@ -0,0 +1,14 @@
.t-transition-enter {
opacity: 0;
}
.t-transition-enter-to {
opacity: 1;
transition: opacity 1s;
}
.t-transition-leave {
opacity: 1;
}
.t-transition-leave-to {
opacity: 0;
transition: opacity 1s;
}

View File

@@ -0,0 +1,22 @@
export interface TdTransitionProps {
appear?: {
type: BooleanConstructor;
value?: boolean;
};
destoryOnHide?: {
type: BooleanConstructor;
value?: boolean;
};
durations?: {
type: null;
value?: number | number[];
};
name?: {
type: StringConstructor;
value?: string;
};
visible?: {
type: BooleanConstructor;
value?: boolean;
};
}

View File

@@ -0,0 +1 @@
export {};