@sumdoo/sumdoo-ui
Version:
轻量级的移动端 Vue3 组件库 (支持小程序开发)
51 lines (50 loc) • 1.56 kB
JavaScript
/*!
* @sumdoo/sumdoo-ui v1.0.0 Wed Feb 09 2022 13:07:24 GMT+0800 (中国标准时间)
* (c) 2022 @sumdoo
* Released under the MIT License.
*/
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle } from "vue";
import { a as addUnit } from "./helper.js";
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
const _sfc_main = defineComponent({
name: "SdIcon",
props: {
type: { type: String },
size: { type: [String, Number] },
color: { type: String },
name: { type: String },
loading: { type: Boolean, default: false },
iconPrefix: { type: String, default: "sd-icon" },
iconfontName: { type: String, default: "sd-iconfont" }
},
setup(props) {
const iconStyle$ = computed(() => {
const style = {};
if (props.size)
style["font-size"] = addUnit(props.size);
if (props.color)
style["color"] = props.color;
if (props.size) {
console.log("", style);
}
return style;
});
return {
iconStyle$
};
}
});
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("i", {
class: normalizeClass([
"sd-icon",
_ctx.iconfontName,
`${_ctx.iconPrefix}-${_ctx.name}`,
_ctx.type ? `sd-icon--${_ctx.type}` : "",
_ctx.loading ? "is-loading" : ""
]),
style: normalizeStyle(_ctx.iconStyle$)
}, null, 6);
}
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export { index as default };