index.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. "use strict";
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  3. exports.__esModule = true;
  4. exports.default = void 0;
  5. var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
  6. var _babelHelperVueJsxMergeProps = _interopRequireDefault(require("@vue/babel-helper-vue-jsx-merge-props"));
  7. var _utils = require("../utils");
  8. var _functional = require("../utils/functional");
  9. var _cell = _interopRequireDefault(require("../cell"));
  10. var _switch = _interopRequireDefault(require("../switch"));
  11. var _shared = require("../switch/shared");
  12. // Utils
  13. // Components
  14. var _createNamespace = (0, _utils.createNamespace)('switch-cell'),
  15. createComponent = _createNamespace[0],
  16. bem = _createNamespace[1];
  17. function SwitchCell(h, props, slots, ctx) {
  18. if (process.env.NODE_ENV === 'development') {
  19. console.warn('[Vant] "SwitchCell" component is deprecated, see: https://vant-ui.github.io/vant/v2/#/zh-CN/switch-cell.');
  20. }
  21. return h(_cell.default, (0, _babelHelperVueJsxMergeProps.default)([{
  22. "attrs": {
  23. "center": true,
  24. "size": props.cellSize,
  25. "title": props.title,
  26. "border": props.border
  27. },
  28. "class": bem([props.cellSize])
  29. }, (0, _functional.inherit)(ctx)]), [h(_switch.default, {
  30. "props": (0, _extends2.default)({}, props),
  31. "on": (0, _extends2.default)({}, ctx.listeners)
  32. })]);
  33. }
  34. SwitchCell.props = (0, _extends2.default)({}, _shared.switchProps, {
  35. title: String,
  36. cellSize: String,
  37. border: {
  38. type: Boolean,
  39. default: true
  40. },
  41. size: {
  42. type: String,
  43. default: '24px'
  44. }
  45. });
  46. var _default = createComponent(SwitchCell);
  47. exports.default = _default;