first commit
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
var uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const iconProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
name: uni_modules_wotDesignUni_components_common_props.makeRequiredProp(String),
|
||||
color: String,
|
||||
size: uni_modules_wotDesignUni_components_common_props.numericProp,
|
||||
classPrefix: uni_modules_wotDesignUni_components_common_props.makeStringProp("wd-icon")
|
||||
};
|
||||
exports.iconProps = iconProps;
|
||||
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
var common_vendor = require("../../../../common/vendor.js");
|
||||
var uni_modules_wotDesignUni_components_common_util = require("../common/util.js");
|
||||
var uni_modules_wotDesignUni_components_wdIcon_types = require("./types.js");
|
||||
require("../common/AbortablePromise.js");
|
||||
require("../common/props.js");
|
||||
const __default__ = {
|
||||
name: "wd-icon",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdIcon_types.iconProps,
|
||||
emits: ["click", "touch"],
|
||||
setup(__props, { emit }) {
|
||||
const props = __props;
|
||||
const isImage = common_vendor.computed$1(() => {
|
||||
return uni_modules_wotDesignUni_components_common_util.isDef(props.name) && props.name.includes("/");
|
||||
});
|
||||
const rootClass = common_vendor.computed$1(() => {
|
||||
const prefix = props.classPrefix;
|
||||
return `${prefix} ${props.customClass} ${isImage.value ? "wd-icon--image" : prefix + "-" + props.name}`;
|
||||
});
|
||||
const rootStyle = common_vendor.computed$1(() => {
|
||||
const style = {};
|
||||
if (props.color) {
|
||||
style["color"] = props.color;
|
||||
}
|
||||
if (props.size) {
|
||||
style["font-size"] = uni_modules_wotDesignUni_components_common_util.addUnit(props.size);
|
||||
}
|
||||
return `${uni_modules_wotDesignUni_components_common_util.objToStyle(style)} ${props.customStyle}`;
|
||||
});
|
||||
function handleClick(event) {
|
||||
emit("click", event);
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.unref(isImage)
|
||||
}, common_vendor.unref(isImage) ? {
|
||||
b: _ctx.name
|
||||
} : {}, {
|
||||
c: common_vendor.o(handleClick),
|
||||
d: common_vendor.n(common_vendor.unref(rootClass)),
|
||||
e: common_vendor.s(common_vendor.unref(rootStyle))
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
var Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-04f65fc7"], ["__file", "D:/\u7F51\u6291\u4E91Time/\u79C1\u6D3B/2000\u7B97\u5366/src/uni_modules/wot-design-uni/components/wd-icon/wd-icon.vue"]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view bindtap="{{c}}" class="{{['data-v-04f65fc7', d]}}" style="{{e}}"><image wx:if="{{a}}" class="wd-icon__image data-v-04f65fc7" src="{{b}}"></image></view>
|
||||
+1102
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
Reference in New Issue
Block a user