VToolbarTitle.mjs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. import { createVNode as _createVNode } from "vue";
  2. // Composables
  3. import { makeComponentProps } from "../../composables/component.mjs";
  4. import { makeTagProps } from "../../composables/tag.mjs"; // Utilities
  5. import { genericComponent, propsFactory, useRender } from "../../util/index.mjs";
  6. export const makeVToolbarTitleProps = propsFactory({
  7. text: String,
  8. ...makeComponentProps(),
  9. ...makeTagProps()
  10. }, 'VToolbarTitle');
  11. export const VToolbarTitle = genericComponent()({
  12. name: 'VToolbarTitle',
  13. props: makeVToolbarTitleProps(),
  14. setup(props, _ref) {
  15. let {
  16. slots
  17. } = _ref;
  18. useRender(() => {
  19. const hasText = !!(slots.default || slots.text || props.text);
  20. return _createVNode(props.tag, {
  21. "class": ['v-toolbar-title', props.class],
  22. "style": props.style
  23. }, {
  24. default: () => [hasText && _createVNode("div", {
  25. "class": "v-toolbar-title__placeholder"
  26. }, [slots.text ? slots.text() : props.text, slots.default?.()])]
  27. });
  28. });
  29. return {};
  30. }
  31. });
  32. //# sourceMappingURL=VToolbarTitle.mjs.map