初始化项目, 添加TDesign等包
This commit is contained in:
3
miniprogram/miniprogram_npm/tdesign-miniprogram/tab-bar/props.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/tab-bar/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdTabBarProps } from './type';
|
||||
declare const props: TdTabBarProps;
|
||||
export default props;
|
||||
@@ -0,0 +1 @@
|
||||
const props={bordered:{type:Boolean,value:!0},fixed:{type:Boolean,value:!0},safeAreaInsetBottom:{type:Boolean,value:!0},shape:{type:String,value:"normal"},split:{type:Boolean,value:!0},theme:{type:String,value:"normal"},value:{type:null,value:null},defaultValue:{type:null}};export default props;
|
||||
28
miniprogram/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.d.ts
vendored
Normal file
28
miniprogram/miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { SuperComponent, RelationsOptions } from '../common/src/index';
|
||||
export default class Tabbar extends SuperComponent {
|
||||
relations: RelationsOptions;
|
||||
externalClasses: string[];
|
||||
backupValue: number;
|
||||
data: {
|
||||
prefix: string;
|
||||
classPrefix: string;
|
||||
};
|
||||
properties: import("./type").TdTabBarProps;
|
||||
controlledProps: {
|
||||
key: string;
|
||||
event: string;
|
||||
}[];
|
||||
observers: {
|
||||
value(): void;
|
||||
};
|
||||
lifetimes: {
|
||||
ready(): void;
|
||||
};
|
||||
methods: {
|
||||
showChildren(): void;
|
||||
updateChildren(): void;
|
||||
updateValue(value: any): void;
|
||||
changeOtherSpread(value: any): void;
|
||||
initName(): any;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
import{__decorate}from"tslib";import{wxComponent,SuperComponent}from"../common/src/index";import config from"../common/config";import props from"./props";const{prefix:prefix}=config,classPrefix=`${prefix}-tab-bar`;let Tabbar=class extends SuperComponent{constructor(){super(...arguments),this.relations={"../tab-bar-item/tab-bar-item":{type:"descendant"}},this.externalClasses=[`${prefix}-class`],this.backupValue=-1,this.data={prefix:prefix,classPrefix:classPrefix},this.properties=props,this.controlledProps=[{key:"value",event:"change"}],this.observers={value(){this.updateChildren()}},this.lifetimes={ready(){this.showChildren()}},this.methods={showChildren(){const{value:e}=this.data;this.$children.forEach(r=>{r.setData({crowded:this.$children.length>3}),r.properties.value===e&&r.showSpread()})},updateChildren(){const{value:e}=this.data;this.$children.forEach(r=>{r.checkActive(e)})},updateValue(e){this._trigger("change",{value:e})},changeOtherSpread(e){this.$children.forEach(r=>{r.properties.value!==e&&r.closeSpread()})},initName(){return this.backupValue+=1}}}};Tabbar=__decorate([wxComponent()],Tabbar);export default Tabbar;
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"styleIsolation":"apply-shared","usingComponents":{}}
|
||||
@@ -0,0 +1 @@
|
||||
<wxs src="../common/utils.wxs" module="_"/><view style="{{_._style([style, customStyle])}}" class="{{_.cls(classPrefix, [['border', bordered], ['fixed', fixed], ['safe', safeAreaInsetBottom], shape])}} class {{prefix}}-class" aria-role="tablist"><slot/></view>
|
||||
@@ -0,0 +1,6 @@
|
||||
@import '../common/style/index.wxss';.t-tab-bar{display:flex;flex-wrap:nowrap;align-items:center;position:relative;font-size:16px;background-color:var(--td-tab-bar-bg-color,var(--td-bg-color-container,var(--td-font-white-1,#fff)));box-sizing:border-box;pointer-events:auto;}
|
||||
.t-tab-bar--normal.t-tab-bar--border::before{z-index:1;position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:0;left:0;top:0;border-top:1px solid var(--td-tab-bar-border-color,var(--td-border-level-1-color,var(--td-gray-color-3,#e7e7e7)));transform:scaleY(.5);transform-origin:0 0;}
|
||||
.t-tab-bar--fixed{position:fixed;left:0;bottom:0;right:0;}
|
||||
.t-tab-bar--normal.t-tab-bar--safe{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);}
|
||||
.t-tab-bar--round{margin-left:32rpx;margin-right:32rpx;border-radius:999px;box-shadow:var(--td-tab-bar-round-shadow,var(--td-shadow-3,0 6px 30px 5px rgba(0,0,0,.05),0 16px 24px 2px rgba(0,0,0,.04),0 8px 10px -5px rgba(0,0,0,.08)));}
|
||||
.t-tab-bar--fixed.t-tab-bar--round.t-tab-bar--safe{bottom:constant(safe-area-inset-bottom);bottom:env(safe-area-inset-bottom);}
|
||||
34
miniprogram/miniprogram_npm/tdesign-miniprogram/tab-bar/type.d.ts
vendored
Normal file
34
miniprogram/miniprogram_npm/tdesign-miniprogram/tab-bar/type.d.ts
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
export interface TdTabBarProps {
|
||||
bordered?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
fixed?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
safeAreaInsetBottom?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
shape?: {
|
||||
type: StringConstructor;
|
||||
value?: 'normal' | 'round';
|
||||
};
|
||||
split?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
theme?: {
|
||||
type: StringConstructor;
|
||||
value?: 'normal' | 'tag';
|
||||
};
|
||||
value?: {
|
||||
type: null;
|
||||
value?: string | number | Array<string | number>;
|
||||
};
|
||||
defaultValue?: {
|
||||
type: null;
|
||||
value?: string | number | Array<string | number>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export{};
|
||||
Reference in New Issue
Block a user