Notify.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 { RED, WHITE } from '../utils/color';
  5. import { emit, inherit } from '../utils/functional';
  6. import { PopupMixin } from '../mixins/popup';
  7. import Popup from '../popup'; // Types
  8. var _use = use('notify'),
  9. sfc = _use[0],
  10. bem = _use[1];
  11. function Notify(h, props, slots, ctx) {
  12. var style = {
  13. color: props.color,
  14. background: props.background
  15. };
  16. return h(Popup, _mergeJSXProps([{
  17. "attrs": {
  18. "value": props.value,
  19. "position": "top",
  20. "overlay": false,
  21. "lockScroll": false
  22. },
  23. "style": style,
  24. "class": [bem(), props.className],
  25. "on": {
  26. "input": function input(value) {
  27. emit(ctx, 'input', value);
  28. }
  29. }
  30. }, inherit(ctx)]), [props.message]);
  31. }
  32. Notify.props = _extends({}, PopupMixin.props, {
  33. className: null,
  34. message: [String, Number],
  35. color: {
  36. type: String,
  37. "default": WHITE
  38. },
  39. background: {
  40. type: String,
  41. "default": RED
  42. },
  43. duration: {
  44. type: Number,
  45. "default": 3000
  46. }
  47. });
  48. export default sfc(Notify);