Notify.mjs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { createVNode as _createVNode } from "vue";
  2. import { defineComponent } from "vue";
  3. import { extend, numericProp, unknownProp, makeStringProp, createNamespace } from "../utils/index.mjs";
  4. import { Popup } from "../popup/index.mjs";
  5. import { popupSharedProps } from "../popup/shared.mjs";
  6. const [name, bem] = createNamespace("notify");
  7. const notifyProps = extend({}, popupSharedProps, {
  8. type: makeStringProp("danger"),
  9. color: String,
  10. message: numericProp,
  11. position: makeStringProp("top"),
  12. className: unknownProp,
  13. background: String,
  14. lockScroll: Boolean
  15. });
  16. var stdin_default = defineComponent({
  17. name,
  18. props: notifyProps,
  19. emits: ["update:show"],
  20. setup(props, {
  21. emit,
  22. slots
  23. }) {
  24. const updateShow = (show) => emit("update:show", show);
  25. return () => _createVNode(Popup, {
  26. "show": props.show,
  27. "class": [bem([props.type]), props.className],
  28. "style": {
  29. color: props.color,
  30. background: props.background
  31. },
  32. "overlay": false,
  33. "position": props.position,
  34. "duration": 0.2,
  35. "lockScroll": props.lockScroll,
  36. "onUpdate:show": updateShow
  37. }, {
  38. default: () => [slots.default ? slots.default() : props.message]
  39. });
  40. }
  41. });
  42. export {
  43. stdin_default as default
  44. };