FloatButtonContent.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
  2. import { createVNode as _createVNode, Fragment as _Fragment } from "vue";
  3. import { defineComponent } from 'vue';
  4. import FileTextOutlined from "@ant-design/icons-vue/es/icons/FileTextOutlined";
  5. import { floatButtonContentProps } from './interface';
  6. import { filterEmpty } from '../_util/props-util';
  7. const FloatButtonContent = defineComponent({
  8. compatConfig: {
  9. MODE: 3
  10. },
  11. name: 'AFloatButtonContent',
  12. inheritAttrs: false,
  13. props: floatButtonContentProps(),
  14. setup(props, _ref) {
  15. let {
  16. attrs,
  17. slots
  18. } = _ref;
  19. return () => {
  20. var _a;
  21. const {
  22. prefixCls
  23. } = props;
  24. const description = filterEmpty((_a = slots.description) === null || _a === void 0 ? void 0 : _a.call(slots));
  25. return _createVNode("div", _objectSpread(_objectSpread({}, attrs), {}, {
  26. "class": [attrs.class, `${prefixCls}-content`]
  27. }), [slots.icon || description.length ? _createVNode(_Fragment, null, [slots.icon && _createVNode("div", {
  28. "class": `${prefixCls}-icon`
  29. }, [slots.icon()]), description.length ? _createVNode("div", {
  30. "class": `${prefixCls}-description`
  31. }, [description]) : null]) : _createVNode("div", {
  32. "class": `${prefixCls}-icon`
  33. }, [_createVNode(FileTextOutlined, null, null)])]);
  34. };
  35. }
  36. });
  37. export default FloatButtonContent;