index.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
  2. import { use } from '../utils';
  3. import Cell from '../cell';
  4. import CellGroup from '../cell-group';
  5. import { inherit } from '../utils/functional'; // Types
  6. var _use = use('panel'),
  7. sfc = _use[0],
  8. bem = _use[1];
  9. function Panel(h, props, slots, ctx) {
  10. var Content = function Content() {
  11. return [slots.header ? slots.header() : h(Cell, {
  12. "attrs": {
  13. "icon": props.icon,
  14. "label": props.desc,
  15. "title": props.title,
  16. "value": props.status,
  17. "valueClass": bem('header-value')
  18. },
  19. "class": bem('header')
  20. }), h("div", {
  21. "class": bem('content')
  22. }, [slots["default"] && slots["default"]()]), slots.footer && h("div", {
  23. "class": [bem('footer'), 'van-hairline--top']
  24. }, [slots.footer()])];
  25. };
  26. return h(CellGroup, _mergeJSXProps([{
  27. "class": bem(),
  28. "scopedSlots": {
  29. "default": Content
  30. }
  31. }, inherit(ctx, true)]));
  32. }
  33. Panel.props = {
  34. icon: String,
  35. desc: String,
  36. title: String,
  37. status: String
  38. };
  39. export default sfc(Panel);