component.tsx 855 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { css } from "@linaria/core";
  2. import { string } from "vue-types";
  3. import { useCompData } from ".";
  4. import { Text } from "../../../basicUI";
  5. import { createUIComp } from "../../../defines/createUIComp";
  6. export const Component = createUIComp({
  7. props: {
  8. compId: string().isRequired,
  9. },
  10. setup(props) {
  11. const { value, children } = useCompData(props.compId);
  12. return () => (
  13. <div class={"py-10px"}>
  14. <Text.Component compId={children.title} />
  15. <div
  16. class={compStyle}
  17. style={{
  18. "--theme-color": value.themeColor,
  19. }}
  20. >
  21. <Text.Component compId={children.subTitle} />
  22. </div>
  23. </div>
  24. );
  25. },
  26. });
  27. const compStyle = css`
  28. width: 150px;
  29. margin: 0 auto;
  30. border-top: 1px solid;
  31. border-bottom: 1px solid;
  32. border-color: var(--theme-color);
  33. `;