增加新模块
This commit is contained in:
+94
@@ -0,0 +1,94 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
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
|
||||
},
|
||||
// item 之间的间距
|
||||
gap: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.radioGroup.gap
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-radio-group/props.js.map
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
const RadioGroup = {
|
||||
// radio-group组件
|
||||
radioGroup: {
|
||||
value: "",
|
||||
disabled: false,
|
||||
shape: "circle",
|
||||
activeColor: "#2979ff",
|
||||
inactiveColor: "#c8c9cc",
|
||||
name: "",
|
||||
size: 18,
|
||||
placement: "row",
|
||||
label: "",
|
||||
labelColor: "#303133",
|
||||
labelSize: 14,
|
||||
labelDisabled: false,
|
||||
iconColor: "#ffffff",
|
||||
iconSize: 12,
|
||||
borderBottom: false,
|
||||
iconPlacement: "left",
|
||||
gap: "10px"
|
||||
}
|
||||
};
|
||||
exports.RadioGroup = RadioGroup;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-radio-group/radioGroup.js.map
|
||||
Vendored
+79
@@ -0,0 +1,79 @@
|
||||
"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 uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.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"]);
|
||||
},
|
||||
radioGroupStyle() {
|
||||
const style = {
|
||||
gap: uni_modules_uviewPlus_libs_function_index.addUnit(this.gap)
|
||||
};
|
||||
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, uni_modules_uviewPlus_libs_function_index.addStyle(this.customStyle));
|
||||
}
|
||||
},
|
||||
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),
|
||||
b: common_vendor.s($options.radioGroupStyle)
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cbc8bf70"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-radio-group/u-radio-group.js.map
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
<view class="{{['u-radio-group', 'data-v-cbc8bf70', a]}}" style="{{b}}"><slot></slot></view>
|
||||
Vendored
+59
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/* uni.scss */
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
.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,
|
||||
.up-empty.data-v-cbc8bf70,
|
||||
.up-empty__wrap.data-v-cbc8bf70,
|
||||
.up-tabs.data-v-cbc8bf70,
|
||||
.up-tabs__wrapper.data-v-cbc8bf70,
|
||||
.up-tabs__wrapper__scroll-view-wrapper.data-v-cbc8bf70,
|
||||
.up-tabs__wrapper__scroll-view.data-v-cbc8bf70,
|
||||
.up-tabs__wrapper__nav.data-v-cbc8bf70,
|
||||
.up-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;
|
||||
}
|
||||
Reference in New Issue
Block a user