UNPKG

song-ui-u

Version:

vue3 + js的PC前端组件库

1 lines 1.84 kB
{"version":3,"file":"container.vue.cjs","sources":["../../../../../packages/components/container/src/container.vue"],"sourcesContent":["<template>\n <section :class=\"[ns.b(), ns.is('vertical', isVertical)]\">\n <slot />\n </section>\n</template>\n<script>\nexport default { name: \"x-container\" };\n</script>\n<script setup>\nimport { computed, useSlots } from \"vue\";\nimport { useNamespace } from \"@ui-library/hook\";\nconst ns = useNamespace(\"container\");\n// slots\nconst slots = useSlots();\n/** props */\nconst props = defineProps({\n direction: {\n type: String,\n default: \"\",\n },\n});\n\nconst isVertical = computed(() => {\n if (props.direction === \"vertical\") {\n return true;\n }\n if (props.direction === \"horizontal\") {\n return false;\n }\n if (slots && slots.default) {\n const slotsNodes = slots.default();\n const tag = slotsNodes.some((nodes) =>\n [\"x-header\", \"x-footer\"].includes(nodes.type.name)\n );\n return tag;\n }\n return false;\n});\n</script>\n"],"names":["useNamespace","useSlots","computed"],"mappings":";;;;;;;;AAMA,MAAe,WAAA,GAAA,EAAE,IAAI,EAAE,aAAa,EAAE,CAAA;;;;;;;;;;;;AAKtC,MAAM,EAAE,GAAGA,kBAAY,CAAC,WAAW,CAAC,CAAA;AACpC;AACA,MAAM,KAAK,GAAGC,YAAQ,EAAE,CAAA;AACxB;AACA,MAAM,KAAK,GAAG,OAKZ,CAAA;;AAEF,MAAM,UAAU,GAAGC,YAAQ,CAAC,MAAM;AAClC,EAAE,IAAI,KAAK,CAAC,SAAS,KAAK,UAAU,EAAE;AACtC,IAAI,OAAO,IAAI,CAAA;AACf,GAAE;AACF,EAAE,IAAI,KAAK,CAAC,SAAS,KAAK,YAAY,EAAE;AACxC,IAAI,OAAO,KAAK,CAAA;AAChB,GAAE;AACF,EAAE,IAAI,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE;AAC9B,IAAI,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,EAAE,CAAA;AACtC,IAAI,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK;AACtC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAA;AACvD,KAAK,CAAA;AACL,IAAI,OAAO,GAAG,CAAA;AACd,GAAE;AACF,EAAE,OAAO,KAAK,CAAA;AACd,CAAC,CAAC,CAAA;;;;;;;;;;;;;;;;;;;;"}