UNPKG

yanzhen-design-vue

Version:

37 lines (36 loc) 933 B
import { propsSeparate, buildProps, definePropType, buildEmits } from "@yanzhen-libs/utils-vue"; import antButtonTypes from "ant-design-vue/es/button/buttonTypes"; import "../../../hooks/index.mjs"; import { useNamespace } from "../../../hooks/use-namespace/index.mjs"; const ns = useNamespace("button"); const buttonOptions = { ns, class: ns.b(), name: ns.defineVNodeName() }; const buttonName = buttonOptions.name; const AntButton = propsSeparate(antButtonTypes()); const buttonTypes = ["default", "primary", "ghost", "dashed", "link", "text"]; const buttonProps = buildProps({ ...AntButton.props, // 扩展类型 text: { type: [String, Number], default: "" }, type: { type: definePropType(String), values: buttonTypes, default: buttonTypes[0] } }); const buttonEmits = buildEmits({ ...AntButton.emits }); export { AntButton, buttonEmits, buttonName, buttonOptions, buttonProps };