type ItemType = { value : string, name : string, } export default { data() { return { title: 'radio 单选框', items: [{ value: 'USA', name: '美国' }, { value: 'CHN', name: '中国' }, { value: 'BRA', name: '巴西' }, { value: 'JPN', name: '日本' }, { value: 'ENG', name: '英国' }, { value: 'FRA', name: '法国' }, ] as ItemType[], current: 0 } }, methods: { radioChange(e : string) { for (let i = 0; i < this.items.length; i++) { if (this.items[i].value === e) { this.current = i; break; } } } } } const GenPagesComponentRadioRadioStyles = [new Map>>([["common-page-head", new Map([["", new Map([["paddingTop", "35rpx"], ["paddingRight", "35rpx"], ["paddingBottom", "35rpx"], ["paddingLeft", "35rpx"], ["flexDirection", "row"], ["justifyContent", "center"]])]])], ["common-page-head-title-box", new Map([["", new Map([["paddingTop", 0], ["paddingRight", "40rpx"], ["paddingBottom", 0], ["paddingLeft", "40rpx"], ["height", "88rpx"], ["borderBottomWidth", "2rpx"], ["borderBottomStyle", "solid"], ["borderBottomColor", "#D8D8D8"]])]])], ["common-page-head-title", new Map([["", new Map([["lineHeight", "88rpx"], ["fontSize", "30rpx"], ["color", "#BEBEBE"]])]])], ["uni-list-cell", new Map([["", new Map([["justifyContent", "flex-start"]])]])]])] @Suppress("UNUSED_PARAMETER") function GenPagesComponentRadioRadioRender(_ctx: GenPagesComponentRadioRadio): VNode | null { const _component_page_head = resolveComponent("page-head") const _component_radio = resolveComponent("radio") const _component_radio_group = resolveComponent("radio-group") return createElementVNode("view", null, [ createVNode(_component_page_head, new Map([["title", _ctx.title]]), null, 8 /* PROPS */, ["title"]), createElementVNode("view", new Map([["class", "uni-padding-wrap"]]), [ createElementVNode("view", new Map([["class", "uni-title uni-common-mt"]]), [ createElementVNode("text", new Map([["class", "uni-title-text"]]), " 默认样式 ") ]), createElementVNode("view", new Map([["class", "uni-flex uni-row"]]), [ createVNode(_component_radio, new Map([ ["value", "r1"], ["checked", true], ["style", "margin-right: 30rpx;"] ]), new Map([ ["default", ((): any[] => [ createElementVNode("text", null, "选中") ])], ["_", 1 /* STABLE */] ])), createVNode(_component_radio, new Map([["value", "r2"]]), new Map([ ["default", ((): any[] => [ createElementVNode("text", null, "未选中") ])], ["_", 1 /* STABLE */] ])) ]) ]), createElementVNode("view", new Map([["class", "uni-padding-wrap"]]), [ createElementVNode("view", new Map([["class", "uni-title uni-common-mt"]]), [ createElementVNode("text", new Map([["class", "uni-title-text"]]), " 不同颜色和尺寸的radio ") ]), createElementVNode("view", new Map([["class", "uni-flex uni-row"]]), [ createVNode(_component_radio, new Map([ ["value", "r1"], ["checked", true], ["color", "#FFCC33"], ["style", "transform:scale(0.7); margin-right: 30rpx;"] ]), new Map([ ["default", ((): any[] => [ createElementVNode("text", null, "选中 ") ])], ["_", 1 /* STABLE */] ])), createVNode(_component_radio, new Map([ ["value", "r2"], ["color", "#FFCC33"], ["style", "transform:scale(0.7)"] ]), new Map([ ["default", ((): any[] => [ createElementVNode("text", null, "未选中") ])], ["_", 1 /* STABLE */] ])) ]) ]), createElementVNode("view", new Map([["class", "uni-padding-wrap"]]), [ createElementVNode("view", new Map([["class", "uni-title uni-common-mt"]]), [ createElementVNode("text", new Map([["class", "uni-title-text"]]), " 推荐展示样式 ") ]) ]), createElementVNode("view", new Map([["class", "uni-list"]]), [ createVNode(_component_radio_group, new Map([["onChange", _ctx.radioChange]]), new Map([ ["default", ((): any[] => [ createElementVNode(Fragment, null, RenderHelpers.renderList(_ctx.items, (item, index, _):VNode => { return createElementVNode("view", new Map([ ["class", "uni-list-cell uni-list-cell-pd"], ["key", item.value] ]), [ createElementVNode("view", null, [ createVNode(_component_radio, new Map([ ["value", item.value], ["checked", index === _ctx.current] ]), new Map([ ["default", ((): any[] => [ createElementVNode("text", null, toDisplayString(item.name), 1 /* TEXT */) ])], ["_", 2 /* DYNAMIC */] ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["value", "checked"]) ]) ]) }), 128 /* KEYED_FRAGMENT */) ])], ["_", 1 /* STABLE */] ]), 8 /* PROPS */, ["onChange"]) ]) ]) }