feat: migrate Toast and Table with reviewed state focus and SSR contracts

This commit is contained in:
maoyingjie
2026-10-24 07:19:26 +08:00
parent 0cfe7b6195
commit ed41af5294
95 changed files with 9358 additions and 8 deletions
@@ -0,0 +1,27 @@
<script lang="ts">
import { defineComponent, h, Fragment, useAttrs, type PropType } from "vue";
/**
* Declarative items renderer for rows. Use the default scoped slot with
* each item, matching the upstream Table.Collection API.
*/
export default defineComponent({
name: "TableCollection",
inheritAttrs: false,
props: {
items: { type: Array as PropType<unknown[]>, default: () => [] },
as: { type: String, default: undefined },
},
setup(props, { slots }) {
const attrs = useAttrs();
return () => {
const children = (props.items ?? []).map((item, index) =>
slots.default?.({ item, index }),
);
return props.as
? h(props.as, { ...attrs, "data-slot": "table-collection" }, children)
: h(Fragment, children);
};
},
});
</script>