first commit
This commit is contained in:
87
unpackage/dist/dev/mp-alipay/uni_modules/uview-plus/components/u-radio-group/props.js
vendored
Normal file
87
unpackage/dist/dev/mp-alipay/uni_modules/uview-plus/components/u-radio-group/props.js
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = {
|
||||
props: {
|
||||
// 绑定的值
|
||||
modelValue: {
|
||||
type: [String, Number, Boolean],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.value
|
||||
},
|
||||
// 是否禁用全部radio
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.disabled
|
||||
},
|
||||
// 形状,circle-圆形,square-方形
|
||||
shape: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.shape
|
||||
},
|
||||
// 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
|
||||
activeColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.activeColor
|
||||
},
|
||||
// 未选中的颜色
|
||||
inactiveColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.inactiveColor
|
||||
},
|
||||
// 标识符
|
||||
name: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.name
|
||||
},
|
||||
// 整个组件的尺寸,默认px
|
||||
size: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.size
|
||||
},
|
||||
// 布局方式,row-横向,column-纵向
|
||||
placement: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.placement
|
||||
},
|
||||
// label的文本
|
||||
label: {
|
||||
type: [String],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.label
|
||||
},
|
||||
// label的颜色 (默认 '#303133' )
|
||||
labelColor: {
|
||||
type: [String],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.labelColor
|
||||
},
|
||||
// label的字体大小,px单位
|
||||
labelSize: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.labelSize
|
||||
},
|
||||
// 是否禁止点击文本操作checkbox(默认 false )
|
||||
labelDisabled: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.labelDisabled
|
||||
},
|
||||
// 图标颜色
|
||||
iconColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.iconColor
|
||||
},
|
||||
// 图标的大小,单位px
|
||||
iconSize: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.iconSize
|
||||
},
|
||||
// 竖向配列时,是否显示下划线
|
||||
borderBottom: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.borderBottom
|
||||
},
|
||||
// 图标与文字的对齐方式
|
||||
iconPlacement: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radio.iconPlacement
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.props = props;
|
||||
27
unpackage/dist/dev/mp-alipay/uni_modules/uview-plus/components/u-radio-group/u-radio-group.acss
vendored
Normal file
27
unpackage/dist/dev/mp-alipay/uni_modules/uview-plus/components/u-radio-group/u-radio-group.acss
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
.u-empty.data-v-cbc8bf70,
|
||||
.u-empty__wrap.data-v-cbc8bf70,
|
||||
.u-tabs.data-v-cbc8bf70,
|
||||
.u-tabs__wrapper.data-v-cbc8bf70,
|
||||
.u-tabs__wrapper__scroll-view-wrapper.data-v-cbc8bf70,
|
||||
.u-tabs__wrapper__scroll-view.data-v-cbc8bf70,
|
||||
.u-tabs__wrapper__nav.data-v-cbc8bf70,
|
||||
.u-tabs__wrapper__nav__line.data-v-cbc8bf70 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
flex-basis: auto;
|
||||
align-items: stretch;
|
||||
align-content: flex-start;
|
||||
}
|
||||
.u-radio-group.data-v-cbc8bf70 {
|
||||
flex: 1;
|
||||
}
|
||||
.u-radio-group--row.data-v-cbc8bf70 {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
.u-radio-group--column.data-v-cbc8bf70 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="{{('u-radio-group') + ' ' + 'data-v-cbc8bf70' + ' ' + a}}"><slot></slot></view>
|
||||
70
unpackage/dist/dev/mp-alipay/uni_modules/uview-plus/components/u-radio-group/u-radio-group.js
vendored
Normal file
70
unpackage/dist/dev/mp-alipay/uni_modules/uview-plus/components/u-radio-group/u-radio-group.js
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_components_uRadioGroup_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "u-radio-group",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uRadioGroup_props.props],
|
||||
computed: {
|
||||
// 这里computed的变量,都是子组件u-radio需要用到的,由于头条小程序的兼容性差异,子组件无法实时监听父组件参数的变化
|
||||
// 所以需要手动通知子组件,这里返回一个parentData变量,供watch监听,在其中去通知每一个子组件重新从父组件(u-radio-group)
|
||||
// 拉取父组件新的变化后的参数
|
||||
parentData() {
|
||||
return [
|
||||
this.modelValue,
|
||||
this.disabled,
|
||||
this.inactiveColor,
|
||||
this.activeColor,
|
||||
this.size,
|
||||
this.labelDisabled,
|
||||
this.shape,
|
||||
this.iconSize,
|
||||
this.borderBottom,
|
||||
this.placement
|
||||
];
|
||||
},
|
||||
bemClass() {
|
||||
return this.bem("radio-group", ["placement"]);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 当父组件需要子组件需要共享的参数发生了变化,手动通知子组件
|
||||
parentData() {
|
||||
if (this.children.length) {
|
||||
this.children.map((child) => {
|
||||
typeof child.init === "function" && child.init();
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.children = [];
|
||||
},
|
||||
emits: ["update:modelValue", "change"],
|
||||
methods: {
|
||||
// 将其他的radio设置为未选中的状态
|
||||
unCheckedOther(childInstance) {
|
||||
this.children.map((child) => {
|
||||
if (childInstance !== child) {
|
||||
child.checked = false;
|
||||
}
|
||||
});
|
||||
const {
|
||||
name
|
||||
} = childInstance;
|
||||
this.$emit("update:modelValue", name);
|
||||
this.$emit("change", name);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.n($options.bemClass)
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cbc8bf70"]]);
|
||||
my.createComponent(Component);
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"component": true,
|
||||
"styleIsolation": "apply-shared",
|
||||
"usingComponents": {}
|
||||
}
|
||||
Reference in New Issue
Block a user