|
@@ -1,75 +0,0 @@
|
|
|
-import { Dict_Imgs } from "@/dict";
|
|
|
-import { css } from "@linaria/core";
|
|
|
-import { reactive, watch } from "vue";
|
|
|
-import { string } from "vue-types";
|
|
|
-import { Image, Text } from "../../..";
|
|
|
-import { createUIComp } from "../../../defines/createUIComp";
|
|
|
-import { useCompData } from ".";
|
|
|
-
|
|
|
-export const Component = createUIComp({
|
|
|
- props: {
|
|
|
- compId: string().isRequired,
|
|
|
- },
|
|
|
- setup(props) {
|
|
|
- const { value, children } = useCompData(props.compId);
|
|
|
-
|
|
|
- watch(
|
|
|
- () => [value.cardColumns],
|
|
|
- () => {
|
|
|
- const { cardColumns, list } = value;
|
|
|
- const offset = cardColumns - list.length;
|
|
|
- if (offset > 0) {
|
|
|
- Array.from({ length: offset }, () => {
|
|
|
- list.push({ name: "name", img: Dict_Imgs.Default, desc: "xxx" });
|
|
|
- });
|
|
|
- } else {
|
|
|
- list.splice(cardColumns, offset * -1);
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- return () => (
|
|
|
- <>
|
|
|
- <Text.Component compId={children.title.id} />
|
|
|
- <Text.Component compId={children.desc.id} />
|
|
|
- <div class="flex space-x-16px">
|
|
|
- {value.list.map((d, i) => (
|
|
|
- <div class="w-0 flex-1 relative">
|
|
|
- <Image.Component
|
|
|
- class={imgStyle}
|
|
|
- style={{ borderColor: value.themeColor }}
|
|
|
- v-model={[d.img, "value"]}
|
|
|
- />
|
|
|
- <div
|
|
|
- class={numberStyle}
|
|
|
- style={{ backgroundColor: value.themeColor }}
|
|
|
- >
|
|
|
- {(++i / 100).toString().split(".")[1]}
|
|
|
- </div>
|
|
|
- <Text.Component class="mt-24px" v-model={[d.name, "value"]} />
|
|
|
- <Text.Component v-model={[d.desc, "value"]} />
|
|
|
- </div>
|
|
|
- ))}
|
|
|
- </div>
|
|
|
- </>
|
|
|
- );
|
|
|
- },
|
|
|
-});
|
|
|
-
|
|
|
-const imgStyle = css`
|
|
|
- border-bottom: 2px solid;
|
|
|
-`;
|
|
|
-
|
|
|
-const numberStyle = css`
|
|
|
- position: absolute;
|
|
|
- left: 50%;
|
|
|
- border-radius: 50%;
|
|
|
- width: 0.8rem;
|
|
|
- height: 0.8rem;
|
|
|
- text-align: center;
|
|
|
- font-size: 0.18rem;
|
|
|
- line-height: 0.8rem;
|
|
|
- box-sizing: content-box;
|
|
|
- border: 3px solid #fff;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
-`;
|