index.js 1.1 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 Button from '../button';
  5. import { emit, inherit } from '../utils/functional';
  6. import { functionalRoute, routeProps } from '../utils/router'; // Types
  7. var _use = use('goods-action-big-btn'),
  8. sfc = _use[0],
  9. bem = _use[1];
  10. function GoodsActionBigBtn(h, props, slots, ctx) {
  11. var onClick = function onClick(event) {
  12. emit(ctx, 'click', event);
  13. functionalRoute(ctx);
  14. };
  15. return h(Button, _mergeJSXProps([{
  16. "attrs": {
  17. "square": true,
  18. "size": "large",
  19. "loading": props.loading,
  20. "disabled": props.disabled,
  21. "type": props.primary ? 'danger' : 'warning'
  22. },
  23. "class": bem(),
  24. "on": {
  25. "click": onClick
  26. }
  27. }, inherit(ctx)]), [slots["default"] ? slots["default"]() : props.text]);
  28. }
  29. GoodsActionBigBtn.props = _extends({}, routeProps, {
  30. text: String,
  31. primary: Boolean,
  32. loading: Boolean,
  33. disabled: Boolean
  34. });
  35. export default sfc(GoodsActionBigBtn);