初始化项目, 添加TDesign等包
This commit is contained in:
3
miniprogram/miniprogram_npm/tdesign-miniprogram/overlay/index.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/overlay/index.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './props';
|
||||
export * from './type';
|
||||
export * from './overlay';
|
||||
@@ -0,0 +1 @@
|
||||
export*from"./props";export*from"./type";export*from"./overlay";
|
||||
22
miniprogram/miniprogram_npm/tdesign-miniprogram/overlay/overlay.d.ts
vendored
Normal file
22
miniprogram/miniprogram_npm/tdesign-miniprogram/overlay/overlay.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { SuperComponent } from '../common/src/index';
|
||||
import { TdOverlayProps } from './type';
|
||||
export interface OverlayProps extends TdOverlayProps {
|
||||
}
|
||||
export default class Overlay extends SuperComponent {
|
||||
properties: TdOverlayProps;
|
||||
behaviors: string[];
|
||||
data: {
|
||||
prefix: string;
|
||||
classPrefix: string;
|
||||
computedStyle: string;
|
||||
_zIndex: number;
|
||||
};
|
||||
observers: {
|
||||
backgroundColor(v: any): void;
|
||||
zIndex(v: any): void;
|
||||
};
|
||||
methods: {
|
||||
handleClick(): void;
|
||||
noop(): void;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
import{__decorate}from"tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import props from"./props";import transition from"../mixins/transition";import useCustomNavbar from"../mixins/using-custom-navbar";const{prefix:prefix}=config,name=`${prefix}-overlay`;let Overlay=class extends SuperComponent{constructor(){super(...arguments),this.properties=props,this.behaviors=[transition(),useCustomNavbar],this.data={prefix:prefix,classPrefix:name,computedStyle:"",_zIndex:11e3},this.observers={backgroundColor(o){this.setData({computedStyle:o?`background-color: ${o};`:""})},zIndex(o){0!==o&&this.setData({_zIndex:o})}},this.methods={handleClick(){this.triggerEvent("click",{visible:!this.properties.visible})},noop(){}}}};Overlay=__decorate([wxComponent()],Overlay);export default Overlay;
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"styleIsolation":"apply-shared"}
|
||||
@@ -0,0 +1 @@
|
||||
<wxs src="../common/utils.wxs" module="_"/><view wx:if="{{realVisible && preventScrollThrough}}" class="{{prefix}}-overlay {{transitionClass}} class" style="{{_._style(['--td-overlay-transition-duration:' + duration + 'ms', 'z-index:' + _zIndex, 'top:' + distanceTop + 'px', computedStyle, style, customStyle])}}" bind:tap="handleClick" catchtouchmove="noop" bind:transitionend="onTransitionEnd" aria-role="{{ ariaRole || 'button' }}" aria-label="{{ ariaLabel || '关闭' }}"><slot/></view><view wx:elif="{{realVisible}}" class="{{prefix}}-overlay {{transitionClass}} class" style="{{_._style(['z-index:' + _zIndex, 'top:' + distanceTop + 'px', computedStyle, style, customStyle])}}" bind:tap="handleClick" bind:transitionend="onTransitionEnd" aria-role="{{ ariaRole || 'button' }}" aria-label="{{ ariaLabel || '关闭' }}"><slot/></view>
|
||||
@@ -0,0 +1,3 @@
|
||||
@import '../common/style/index.wxss';.t-overlay{position:fixed;top:0;left:0;width:100%;bottom:0;background-color:var(--td-overlay-bg-color,var(--td-mask-active,rgba(0,0,0,.6)));transition-property:opacity;transition-duration:var(--td-overlay-transition-duration,300ms);transition-timing-function:ease;}
|
||||
.t-fade-enter{opacity:0;}
|
||||
.t-fade-leave-to{opacity:0;}
|
||||
3
miniprogram/miniprogram_npm/tdesign-miniprogram/overlay/props.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/overlay/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdOverlayProps } from './type';
|
||||
declare const props: TdOverlayProps;
|
||||
export default props;
|
||||
@@ -0,0 +1 @@
|
||||
const props={backgroundColor:{type:String,value:""},duration:{type:Number,value:300},preventScrollThrough:{type:Boolean,value:!0},zIndex:{type:Number,value:11e3}};export default props;
|
||||
26
miniprogram/miniprogram_npm/tdesign-miniprogram/overlay/type.d.ts
vendored
Normal file
26
miniprogram/miniprogram_npm/tdesign-miniprogram/overlay/type.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
export interface TdOverlayProps {
|
||||
backgroundColor?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
duration?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
preventScrollThrough?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
usingCustomNavbar?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
visible?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
zIndex?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export{};
|
||||
Reference in New Issue
Block a user