UNPKG

yanzhen-design-vue

Version:

51 lines (50 loc) 1.13 kB
import { buildProps, definePropType, buildEmits, propsSeparate } from "@yanzhen-libs/utils-vue"; import "../../../hooks/index.mjs"; import { useNamespace } from "../../../hooks/use-namespace/index.mjs"; const ns = useNamespace("list"); const listOptions = { ns, name: ns.defineVNodeName() }; const listName = listOptions.name; const listModes = ["default", "virtual", "tree"]; const listProps = buildProps({ class: definePropType(null), style: definePropType(null), mode: { type: definePropType(String), values: listModes, default: listModes[0] }, dataSource: { type: definePropType(Array), default: () => [] }, loading: { type: Boolean, default: false }, disabled: { type: Boolean, default: false }, height: [Number, String], distance: { type: Number, default: 100 }, tag: { type: String, default: "ul" }, onLoadMore: definePropType(Function), ["onUpdate:loading"]: definePropType(Function) }); const listEmits = buildEmits(propsSeparate(listProps).emits); export { listEmits, listModes, listName, listOptions, listProps };