打包地址
This commit is contained in:
+96
@@ -0,0 +1,96 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "u-icon",
|
||||
beforeCreate() {
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
emits: ["click"],
|
||||
mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$1],
|
||||
computed: {
|
||||
uClasses() {
|
||||
let classes = [];
|
||||
classes.push(this.customPrefix + "-" + this.name);
|
||||
if (this.customPrefix == "uicon") {
|
||||
classes.push("u-iconfont");
|
||||
} else {
|
||||
classes.push(this.customPrefix);
|
||||
}
|
||||
if (this.color && common_vendor.config.type.includes(this.color))
|
||||
classes.push("u-icon__icon--" + this.color);
|
||||
return classes;
|
||||
},
|
||||
iconStyle() {
|
||||
let style = {};
|
||||
style = {
|
||||
fontSize: common_vendor.addUnit(this.size),
|
||||
lineHeight: common_vendor.addUnit(this.size),
|
||||
fontWeight: this.bold ? "bold" : "normal",
|
||||
// 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
|
||||
top: common_vendor.addUnit(this.top)
|
||||
};
|
||||
if (this.color && !common_vendor.config.type.includes(this.color))
|
||||
style.color = this.color;
|
||||
return style;
|
||||
},
|
||||
// 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
|
||||
isImg() {
|
||||
return this.name.indexOf("/") !== -1;
|
||||
},
|
||||
imgStyle() {
|
||||
let style = {};
|
||||
style.width = this.width ? common_vendor.addUnit(this.width) : common_vendor.addUnit(this.size);
|
||||
style.height = this.height ? common_vendor.addUnit(this.height) : common_vendor.addUnit(this.size);
|
||||
return style;
|
||||
},
|
||||
// 通过图标名,查找对应的图标
|
||||
icon() {
|
||||
if (this.customPrefix !== "uicon") {
|
||||
return this.customIcons[this.customPrefix + "-" + this.name] || this.name;
|
||||
}
|
||||
return common_vendor.icons["uicon-" + this.name] || this.name;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addStyle: common_vendor.addStyle,
|
||||
addUnit: common_vendor.addUnit,
|
||||
clickHandler(e) {
|
||||
this.$emit("click", this.index, e);
|
||||
this.stop && this.preventEvent(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: $options.isImg
|
||||
}, $options.isImg ? {
|
||||
b: _ctx.name,
|
||||
c: _ctx.imgMode,
|
||||
d: common_vendor.s($options.imgStyle),
|
||||
e: common_vendor.s($options.addStyle(_ctx.customStyle))
|
||||
} : {
|
||||
f: common_vendor.t($options.icon),
|
||||
g: common_vendor.n($options.uClasses),
|
||||
h: common_vendor.s($options.iconStyle),
|
||||
i: common_vendor.s($options.addStyle(_ctx.customStyle)),
|
||||
j: _ctx.hoverClass
|
||||
}, {
|
||||
k: _ctx.label !== ""
|
||||
}, _ctx.label !== "" ? {
|
||||
l: common_vendor.t(_ctx.label),
|
||||
m: _ctx.labelColor,
|
||||
n: $options.addUnit(_ctx.labelSize),
|
||||
o: _ctx.labelPos == "right" ? $options.addUnit(_ctx.space) : 0,
|
||||
p: _ctx.labelPos == "bottom" ? $options.addUnit(_ctx.space) : 0,
|
||||
q: _ctx.labelPos == "left" ? $options.addUnit(_ctx.space) : 0,
|
||||
r: _ctx.labelPos == "top" ? $options.addUnit(_ctx.space) : 0
|
||||
} : {}, {
|
||||
s: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args)),
|
||||
t: common_vendor.n("u-icon--" + _ctx.labelPos)
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1c933a9a"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/node-modules/uview-plus/components/u-icon/u-icon.js.map
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
<view bindtap="{{s}}" class="{{['u-icon', 'data-v-1c933a9a', t]}}"><image wx:if="{{a}}" class="u-icon__img data-v-1c933a9a" src="{{b}}" mode="{{c}}" style="{{d + ';' + e}}"></image><text wx:else class="{{['u-icon__icon', 'data-v-1c933a9a', g]}}" style="{{h + ';' + i}}" hover-class="{{j}}">{{f}}</text><text wx:if="{{k}}" class="u-icon__label data-v-1c933a9a" style="{{'color:' + m + ';' + ('font-size:' + n) + ';' + ('margin-left:' + o) + ';' + ('margin-top:' + p) + ';' + ('margin-right:' + q) + ';' + ('margin-bottom:' + r)}}">{{l}}</text></view>
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.u-empty.data-v-1c933a9a,
|
||||
.u-empty__wrap.data-v-1c933a9a,
|
||||
.u-tabs.data-v-1c933a9a,
|
||||
.u-tabs__wrapper.data-v-1c933a9a,
|
||||
.u-tabs__wrapper__scroll-view-wrapper.data-v-1c933a9a,
|
||||
.u-tabs__wrapper__scroll-view.data-v-1c933a9a,
|
||||
.u-tabs__wrapper__nav.data-v-1c933a9a,
|
||||
.u-tabs__wrapper__nav__line.data-v-1c933a9a,
|
||||
.up-empty.data-v-1c933a9a,
|
||||
.up-empty__wrap.data-v-1c933a9a,
|
||||
.up-tabs.data-v-1c933a9a,
|
||||
.up-tabs__wrapper.data-v-1c933a9a,
|
||||
.up-tabs__wrapper__scroll-view-wrapper.data-v-1c933a9a,
|
||||
.up-tabs__wrapper__scroll-view.data-v-1c933a9a,
|
||||
.up-tabs__wrapper__nav.data-v-1c933a9a,
|
||||
.up-tabs__wrapper__nav__line.data-v-1c933a9a {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
flex-basis: auto;
|
||||
align-items: stretch;
|
||||
align-content: flex-start;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "uicon-iconfont";
|
||||
src: url("https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf") format("truetype");
|
||||
}
|
||||
.u-icon.data-v-1c933a9a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.u-icon--left.data-v-1c933a9a {
|
||||
flex-direction: row-reverse;
|
||||
align-items: center;
|
||||
}
|
||||
.u-icon--right.data-v-1c933a9a {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.u-icon--top.data-v-1c933a9a {
|
||||
flex-direction: column-reverse;
|
||||
justify-content: center;
|
||||
}
|
||||
.u-icon--bottom.data-v-1c933a9a {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
.u-icon__icon.data-v-1c933a9a {
|
||||
font-family: uicon-iconfont;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.u-icon__icon--primary.data-v-1c933a9a {
|
||||
color: #3c9cff;
|
||||
}
|
||||
.u-icon__icon--success.data-v-1c933a9a {
|
||||
color: #5ac725;
|
||||
}
|
||||
.u-icon__icon--error.data-v-1c933a9a {
|
||||
color: #f56c6c;
|
||||
}
|
||||
.u-icon__icon--warning.data-v-1c933a9a {
|
||||
color: #f9ae3d;
|
||||
}
|
||||
.u-icon__icon--info.data-v-1c933a9a {
|
||||
color: #909399;
|
||||
}
|
||||
.u-icon__img.data-v-1c933a9a {
|
||||
height: auto;
|
||||
will-change: transform;
|
||||
}
|
||||
.u-icon__label.data-v-1c933a9a {
|
||||
line-height: 1;
|
||||
}
|
||||
Reference in New Issue
Block a user