新增管理台,管理轮播图功能
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "fui-vtabs-content",
|
||||
inject: ["vtabs"],
|
||||
props: {
|
||||
tabIndex: {
|
||||
type: [Number, String],
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.vtabs && this.vtabs.linkage) {
|
||||
this.vtabs.children.push(this);
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.calcHeight((height) => {
|
||||
this.vtabs.getCalcHeight(height, Number(this.tabIndex));
|
||||
});
|
||||
}, 300);
|
||||
});
|
||||
}
|
||||
},
|
||||
// TODO vue3
|
||||
beforeUnmount() {
|
||||
this.uninstall();
|
||||
},
|
||||
methods: {
|
||||
calcHeight(callback, index = 0) {
|
||||
common_vendor.index.createSelectorQuery().in(this).select(`#fui-vtabs-content__${this.tabIndex}`).fields({
|
||||
size: true
|
||||
}, (data) => {
|
||||
if (index >= 12)
|
||||
return;
|
||||
if (data && data.height) {
|
||||
callback && callback(data.height);
|
||||
} else {
|
||||
index++;
|
||||
setTimeout(() => {
|
||||
this.calcHeight(callback, index);
|
||||
}, 50);
|
||||
return;
|
||||
}
|
||||
}).exec();
|
||||
},
|
||||
uninstall() {
|
||||
if (this.vtabs && this.vtabs.linkage) {
|
||||
this.vtabs.uninstall(Number(this.tabIndex), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: "fui-vtabs-content__" + $props.tabIndex
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-6fc6d1f1"]]);
|
||||
wx.createComponent(Component);
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
<view ref="fui_vtabs__el" id="{{a}}" class="{{['fui-vtabs-content__wrap', 'data-v-6fc6d1f1', virtualHostClass]}}" style="{{virtualHostStyle}}"><slot></slot></view>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
|
||||
.fui-vtabs-content__wrap.data-v-6fc6d1f1 {
|
||||
|
||||
|
||||
|
||||
|
||||
width: 100%;
|
||||
}
|
||||
Reference in New Issue
Block a user