type Page = { name : string, enable ?: boolean, url ?: string } type ListItem = { id : string, name : string, open : boolean, pages : Page[], url ?: string, enable ?: boolean } export default { data() { return { list: [{ id: 'view', name: '视图容器', open: false, pages: [ { name: 'view', enable: true }, { name: 'scroll-view', enable: true }, { name: 'swiper', enable: false }, { name: 'movable-view', enable: false }, { name: 'cover-view', enable: false }, ] as Page[] }, { id: 'content', name: '基础内容', open: false, pages: [ { name: 'text', enable: false }, { name: 'rich-text', enable: false }, { name: 'progress', enable: true } ] as Page[] }, { id: 'form', name: '表单组件', open: false, pages: [ { name: 'button', enable: true }, { name: 'checkbox', enable: true }, { name: 'form', enable: false }, { name: 'input', enable: true }, { name: 'label', enable: false }, { name: 'picker', enable: false }, { name: 'picker-view', enable: false }, { name: 'radio', enable: true }, { name: 'slider', enable: false }, { name: 'switch', enable: false }, { name: 'textarea', enable: true }, { name: 'editor', enable: false }, ] as Page[] }, { id: 'nav', name: '导航', open: false, pages: [{ name: 'navigator', enable: false }] as Page[] }, { id: 'media', name: '媒体组件', open: false, pages: [{ name: 'image', enable: true }, { name: 'video', enable: false }] as Page[] }, { id: 'map', name: '地图', open: false, pages: [ { name: 'map', enable: false } ] as Page[] }, { id: 'canvas', name: '画布', open: false, pages: [ { name: 'canvas' } ] as Page[] }, { id: 'web-view', name: '网页', open: false, pages: [ { name: '网络网页', enable: false, url: '/pages/component/web-view/web-view' }, { name: '本地网页', enable: false, url: '/pages/component/web-view-local/web-view-local' } ] as Page[] }, { id: 'ad', url: 'ad', name: 'AD组件', enable: false, open: false, pages: [] as Page[] } ] as ListItem[], arrowUpIcon: '/static/icons/arrow-up.png', arrowDownIcon: '/static/icons/arrow-down.png', arrowRightIcon: '/static/icons/arrow-right.png', } }, methods: { triggerCollapse(index ?: number, item : ListItem) { if (item.pages.length == 0) { const page : Page = { name: item.name, enable: item.enable, url: item.url } this.goDetailPage(page); return; } for (var i = 0; i < this.list.length; ++i) { if (index == i) { this.list[i].open = !this.list[i].open; } else { this.list[i].open = false; } } }, goDetailPage(e : Page) { if (e.enable != true) { uni.showToast({ icon: 'none', title: '暂不支持' }) return } const url = e.url != null ? e.url! : `/pages/component/${e.name}/${e.name}` uni.navigateTo({ url }) } } } const GenPagesTabBarComponentComponentStyles = [new Map>>([["text", new Map([["", new Map([["color", "#7A7E83"], ["fontSize", 14], ["lineHeight", 20]])]])], ["uni-icon", new Map([["", new Map([["width", 14], ["height", 14]])]])], ["uni-container", new Map([["", new Map([["paddingTop", 15], ["paddingRight", 15], ["paddingBottom", 15], ["paddingLeft", 15], ["backgroundColor", "#f8f8f8"]])]])], ["uni-header-logo", new Map([["", new Map([["display", "flex"], ["paddingTop", 15], ["paddingRight", 15], ["paddingBottom", 15], ["paddingLeft", 15], ["flexDirection", "column"], ["justifyContent", "center"], ["alignItems", "center"], ["marginTop", "10rpx"]])]])], ["uni-header-image", new Map([["", new Map([["width", 80], ["height", 80]])]])], ["uni-hello-text", new Map([["", new Map([["marginBottom", 20], ["color", "#7A7E83"]])]])], ["hello-text", new Map([["", new Map([["color", "#7A7E83"], ["fontSize", 14], ["lineHeight", 20]])]])], ["hello-link", new Map([["", new Map([["color", "#7A7E83"], ["fontSize", 14], ["lineHeight", 20]])]])], ["uni-panel", new Map([["", new Map([["marginBottom", 12]])]])], ["text-disabled", new Map([["", new Map([["color", "#a0a0a0"]])]])], ["uni-panel-h", new Map([["", new Map([["display", "flex"], ["backgroundColor", "#ffffff"], ["!flexDirection", "row"], ["!justifyContent", "space-between"], ["!alignItems", "center"], ["paddingTop", 12], ["paddingRight", 12], ["paddingBottom", 12], ["paddingLeft", 12]])]])], ["uni-panel-h-on", new Map([["", new Map([["backgroundColor", "#f0f0f0"]])]])], ["uni-panel-text", new Map([["", new Map([["color", "#000000"], ["fontSize", 14], ["fontWeight", "normal"]])]])], ["uni-panel-icon", new Map([["", new Map([["marginLeft", 15], ["color", "#999999"], ["fontSize", 14], ["fontWeight", "normal"], ["transform", "rotate(0deg)"], ["transitionDuration", 0], ["transitionProperty", "transform"]])]])], ["uni-panel-icon-on", new Map([["", new Map([["transform", "rotate(180deg)"]])]])], ["uni-navigate-item", new Map([["", new Map([["display", "flex"], ["flexDirection", "row"], ["alignItems", "center"], ["backgroundColor", "#FFFFFF"], ["borderTopStyle", "solid"], ["borderTopColor", "#f0f0f0"], ["borderTopWidth", 1], ["paddingTop", 12], ["paddingRight", 12], ["paddingBottom", 12], ["paddingLeft", 12], ["justifyContent", "space-between"], ["backgroundColor:active", "#f8f8f8"]])]])], ["uni-navigate-text", new Map([["", new Map([["color", "#000000"], ["fontSize", 14], ["fontWeight", "normal"]])]])], ["uni-navigate-icon", new Map([["", new Map([["marginLeft", 15], ["color", "#999999"], ["fontSize", 14], ["fontWeight", "normal"]])]])], ["arrow", new Map([["", new Map([["width", 8], ["height", 8], ["borderTopWidth", 2], ["borderTopStyle", "solid"], ["borderTopColor", "#cccccc"], ["borderLeftWidth", 2], ["borderLeftStyle", "solid"], ["borderLeftColor", "#cccccc"]])]])], ["arrow-right", new Map([["", new Map([["transform", "rotate(135deg)"]])]])], ["arrow-up", new Map([["", new Map([["transform", "rotate(45deg)"]])]])], ["arrow-down", new Map([["", new Map([["transform", "rotate(-135deg)"]])]])], ["@TRANSITION", new Map([["uni-panel-icon", new Map([["duration", 0], ["property", "transform"]])]])]])] @Suppress("UNUSED_PARAMETER") function GenPagesTabBarComponentComponentRender(_ctx: GenPagesTabBarComponentComponent): VNode | null { const _component_u_link = resolveComponent("u-link") return createElementVNode("view", new Map([["class", "uni-container"]]), [ createElementVNode("view", new Map([["class", "uni-header-logo"]]), [ createElementVNode("image", new Map([ ["class", "uni-header-image"], ["src", "/static/componentIndex.png"] ])) ]), createElementVNode("view", new Map([["class", "uni-hello-text"]]), [ createElementVNode("text", new Map([["class", "hello-text"]]), "uni-app内置组件,展示样式仅供参考,文档详见:"), createVNode(_component_u_link, new Map([ ["href", 'https://uniapp.dcloud.io/component/'], ["text", 'https://uniapp.dcloud.io/component/'], ["inWhiteList", true] ]), null, 8 /* PROPS */, ["href", "text"]) ]), createElementVNode(Fragment, null, RenderHelpers.renderList(_ctx.list, (item, index, _):VNode => { return createElementVNode("view", new Map([ ["class", "uni-panel"], ["key", item.id] ]), [ createElementVNode("view", new Map([ ["class", normalizeClass(["uni-panel-h", item.open ? 'uni-panel-h-on' : ''])], ["onClick", () => {_ctx.triggerCollapse(index, item)}] ]), [ createElementVNode("text", new Map([ ["class", normalizeClass(["uni-panel-text", item.enable == false ? 'text-disabled' : ''])] ]), toDisplayString(item.name), 3 /* TEXT, CLASS */), createElementVNode("image", new Map([ ["src", item.pages.length > 0 ? item.open ? _ctx.arrowUpIcon : _ctx.arrowDownIcon : _ctx.arrowRightIcon], ["class", "uni-icon"] ]), null, 8 /* PROPS */, ["src"]) ], 10 /* CLASS, PROPS */, ["onClick"]), isTrue(item.open) ? createElementVNode("view", new Map([ ["key", 0], ["class", "uni-panel-c"] ]), [ createElementVNode(Fragment, null, RenderHelpers.renderList(item.pages, (page, key, _):VNode => { return createElementVNode("view", new Map([ ["class", "uni-navigate-item"], ["key", key], ["onClick", () => {_ctx.goDetailPage(page)}] ]), [ createElementVNode("text", new Map([ ["class", normalizeClass(["uni-navigate-text", page.enable != true ? 'text-disabled' : ''])] ]), toDisplayString(page.name), 3 /* TEXT, CLASS */), createElementVNode("image", new Map([ ["src", _ctx.arrowRightIcon], ["class", "uni-icon"] ]), null, 8 /* PROPS */, ["src"]) ], 8 /* PROPS */, ["onClick"]) }), 128 /* KEYED_FRAGMENT */) ]) : createCommentVNode("v-if", true) ]) }), 128 /* KEYED_FRAGMENT */) ]) }