first commit
This commit is contained in:
31
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/props.js
vendored
Normal file
31
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/props.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
const props = {
|
||||
/** 透传至 Badge 组件 */
|
||||
badgeProps: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
/** 是否禁用当前选项卡 */
|
||||
disabled: Boolean,
|
||||
/** `1.0.0-rc.1`。图标,传对象则透传至 Icon */
|
||||
icon: {
|
||||
type: [String, Object]
|
||||
},
|
||||
/** 选项卡名称 */
|
||||
label: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
/** 是否启用选项卡懒加载 */
|
||||
lazy: Boolean,
|
||||
/** 用于自定义选项卡面板内容 */
|
||||
panel: {
|
||||
type: String
|
||||
},
|
||||
/** 选项卡的值,唯一标识 */
|
||||
value: {
|
||||
type: [String, Number]
|
||||
}
|
||||
};
|
||||
exports.props = props;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/props.js.map
|
||||
92
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/tab-panel.js
vendored
Normal file
92
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/tab-panel.js
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
"use strict";
|
||||
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
|
||||
const uni_modules_tdesignUniapp_components_tabPanel_props = require("./props.js");
|
||||
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
|
||||
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
|
||||
const uni_modules_tdesignUniapp_components_common_relation_parentMap = require("../common/relation/parent-map.js");
|
||||
const uni_modules_tdesignUniapp_components_common_relation_relation = require("../common/relation/relation.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-tab-panel`;
|
||||
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
|
||||
name,
|
||||
options: {
|
||||
styleIsolation: "shared",
|
||||
virtualHost: true
|
||||
},
|
||||
externalClasses: [`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`],
|
||||
mixins: [uni_modules_tdesignUniapp_components_common_relation_relation.ChildrenMixin(uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.TabPanel)],
|
||||
props: {
|
||||
...uni_modules_tdesignUniapp_components_tabPanel_props.props
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
|
||||
classPrefix: name,
|
||||
active: false,
|
||||
hide: true,
|
||||
id: "",
|
||||
hasActivated: false,
|
||||
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
label: "update",
|
||||
badgeProps: {
|
||||
handler() {
|
||||
this.update();
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
disabled: "update",
|
||||
icon: "update",
|
||||
panel: "update",
|
||||
value: "update",
|
||||
lazy: "update"
|
||||
},
|
||||
methods: {
|
||||
setParent(parent) {
|
||||
this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.TabPanel] = parent;
|
||||
if (!parent.children.includes(this)) {
|
||||
parent.children.push(this);
|
||||
}
|
||||
parent.innerAfterLinked(this);
|
||||
},
|
||||
setId(id) {
|
||||
this.id = id;
|
||||
},
|
||||
getComputedName() {
|
||||
if (this.value != null) {
|
||||
return `${this.value}`;
|
||||
}
|
||||
return `${this.dataIndex}`;
|
||||
},
|
||||
update() {
|
||||
var _a;
|
||||
(_a = this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.TabPanel]) == null ? void 0 : _a.updateTabs();
|
||||
},
|
||||
render(active, parent) {
|
||||
this.initialized = this.initialized || active;
|
||||
if (active && !this.hasActivated) {
|
||||
this.hasActivated = true;
|
||||
}
|
||||
this.active = active;
|
||||
this.hide = !parent.animation && !active;
|
||||
}
|
||||
}
|
||||
});
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: !_ctx.lazy || _ctx.hasActivated
|
||||
}, !_ctx.lazy || _ctx.hasActivated ? common_vendor.e({
|
||||
b: _ctx.panel
|
||||
}, _ctx.panel ? {
|
||||
c: common_vendor.t(_ctx.panel)
|
||||
} : {}, {
|
||||
d: _ctx.id,
|
||||
e: common_vendor.n(_ctx.tClass + " " + _ctx.classPrefix + " " + (_ctx.active ? _ctx.classPrefix + "--active" : _ctx.classPrefix + "--inactive")),
|
||||
f: common_vendor.s(_ctx.tools._style([_ctx.customStyle, _ctx.hide ? "display: none" : ""]))
|
||||
}) : {});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-435266d8"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/tab-panel.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/tab-panel.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/tab-panel.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/tab-panel.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/tab-panel.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view wx:if="{{a}}" id="{{d}}" class="{{['data-v-435266d8', e]}}" style="{{f}}" aria-role="tabpanel"><view wx:if="{{b}}" class="data-v-435266d8">{{c}}</view><slot/><slot name="panel"/></view>
|
||||
15
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/tab-panel.wxss
vendored
Normal file
15
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/tab-panel/tab-panel.wxss
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
.t-tab-panel.data-v-435266d8 {
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.t-tab-panel--active.data-v-435266d8 {
|
||||
height: auto;
|
||||
}
|
||||
.t-tab-panel--inactive.data-v-435266d8 {
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
Reference in New Issue
Block a user