[improvement] GoodsAction: jsx (#2513)

This commit is contained in:
neverland
2019-01-13 08:38:30 +08:00
committed by GitHub
parent 31da78eae6
commit b52a37220f
7 changed files with 90 additions and 105 deletions
+32
View File
@@ -0,0 +1,32 @@
import { use } from '../utils';
import Icon from '../icon';
import RouterLink from '../mixins/router-link';
const [sfc, bem] = use('goods-action-mini-btn');
export default sfc({
mixins: [RouterLink],
props: {
text: String,
info: [String, Number],
icon: String,
iconClass: String
},
methods: {
onClick(event) {
this.$emit('click', event);
this.routerLink();
}
},
render(h) {
return (
<div class={[bem(), 'van-hairline']} onClick={this.onClick}>
<Icon class={[bem('icon'), this.iconClass]} info={this.info} name={this.icon} />
{this.$slots.default || this.text}
</div>
);
}
});