index.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import _extends from "@babel/runtime/helpers/esm/extends";
  2. import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
  3. import { use } from '../utils';
  4. import Icon from '../icon';
  5. import { emit, inherit } from '../utils/functional';
  6. import { functionalRoute, routeProps } from '../utils/router'; // Types
  7. var _use = use('goods-action-mini-btn'),
  8. sfc = _use[0],
  9. bem = _use[1];
  10. function GoodsActionMiniBtn(h, props, slots, ctx) {
  11. var onClick = function onClick(event) {
  12. emit(ctx, 'click', event);
  13. functionalRoute(ctx);
  14. };
  15. return h("div", _mergeJSXProps([{
  16. "class": [bem(), 'van-hairline'],
  17. "on": {
  18. "click": onClick
  19. }
  20. }, inherit(ctx)]), [h(Icon, {
  21. "class": [bem('icon'), props.iconClass],
  22. "attrs": {
  23. "tag": "div",
  24. "info": props.info,
  25. "name": props.icon
  26. }
  27. }), slots["default"] ? slots["default"]() : props.text]);
  28. }
  29. GoodsActionMiniBtn.props = _extends({}, routeProps, {
  30. text: String,
  31. icon: String,
  32. info: [String, Number],
  33. iconClass: null
  34. });
  35. export default sfc(GoodsActionMiniBtn);