index.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import _extends from "@babel/runtime/helpers/esm/extends";
  2. import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
  3. // Utils
  4. import { createNamespace } from '../utils';
  5. import { inherit } from '../utils/functional'; // Components
  6. import Cell from '../cell';
  7. import Switch from '../switch';
  8. import { switchProps } from '../switch/shared'; // Types
  9. var _createNamespace = createNamespace('switch-cell'),
  10. createComponent = _createNamespace[0],
  11. bem = _createNamespace[1];
  12. function SwitchCell(h, props, slots, ctx) {
  13. if (process.env.NODE_ENV === 'development') {
  14. console.warn('[Vant] "SwitchCell" component is deprecated, see: https://vant-ui.github.io/vant/v2/#/zh-CN/switch-cell.');
  15. }
  16. return h(Cell, _mergeJSXProps([{
  17. "attrs": {
  18. "center": true,
  19. "size": props.cellSize,
  20. "title": props.title,
  21. "border": props.border
  22. },
  23. "class": bem([props.cellSize])
  24. }, inherit(ctx)]), [h(Switch, {
  25. "props": _extends({}, props),
  26. "on": _extends({}, ctx.listeners)
  27. })]);
  28. }
  29. SwitchCell.props = _extends({}, switchProps, {
  30. title: String,
  31. cellSize: String,
  32. border: {
  33. type: Boolean,
  34. default: true
  35. },
  36. size: {
  37. type: String,
  38. default: '24px'
  39. }
  40. });
  41. export default createComponent(SwitchCell);