41 lines
1009 B
JavaScript
Executable File
41 lines
1009 B
JavaScript
Executable File
import fmtUnit from '../_util/fmtUnit';
|
||
Component({
|
||
props: {
|
||
className: '',
|
||
// normal: 基础样式;
|
||
// guide:文案加引导;
|
||
// copyright:声明;
|
||
// brand:带品牌;
|
||
// link:带链接
|
||
// end: 没有更多
|
||
type: 'normal',
|
||
content: '',
|
||
extend: [],
|
||
onBrandTap: function onBrandTap() {},
|
||
showEndIcon: false,
|
||
iconName: 'selected'
|
||
},
|
||
data: {
|
||
defaultSize: fmtUnit(18),
|
||
maxSize: fmtUnit(22),
|
||
valueUnit: fmtUnit('px')
|
||
},
|
||
methods: {
|
||
onBrandClick: function onBrandClick(e) {
|
||
var brandLink = e.currentTarget.dataset.url;
|
||
var _this$props = this.props,
|
||
onBrandTap = _this$props.onBrandTap,
|
||
extend = _this$props.extend;
|
||
|
||
if (onBrandTap !== '' && brandLink) {
|
||
my.navigateTo({
|
||
url: brandLink
|
||
});
|
||
}
|
||
|
||
if (onBrandTap !== '' && !brandLink && typeof onBrandTap === 'function') {
|
||
onBrandTap(extend[e.currentTarget.dataset.index]);
|
||
}
|
||
}
|
||
}
|
||
}); |