diff --git a/packages/components/components.ts b/packages/components/components.ts index 6c694e2..873f7fd 100644 --- a/packages/components/components.ts +++ b/packages/components/components.ts @@ -3,3 +3,4 @@ export * from "../core/src/selection/component"; export * from "../core/src/item/component"; export * from "../core/src/icon/component"; export * from "../core/src/switch/component"; +export * from "../core/src/config-provider/component"; diff --git a/packages/core/src/config-provider/component.ts b/packages/core/src/config-provider/component.ts new file mode 100644 index 0000000..98f69b8 --- /dev/null +++ b/packages/core/src/config-provider/component.ts @@ -0,0 +1,20 @@ +import type { PropType } from "vue"; +import { defineComponent, renderSlot } from "vue"; +import type { SharedConfig } from "@hoci/core"; +import { provideSharedConfig } from "@hoci/core"; +export const HiConfigProvider = defineComponent({ + props: { + icon: { + type: Object as PropType + }, + activateEvent: { + type: String as PropType + } + }, + setup(props, context) { + provideSharedConfig(props); + return () => { + return renderSlot(context.slots, "default", undefined); + }; + } +}); diff --git a/packages/core/src/config-provider/index.ts b/packages/core/src/config-provider/index.ts new file mode 100644 index 0000000..9922564 --- /dev/null +++ b/packages/core/src/config-provider/index.ts @@ -0,0 +1,26 @@ +import { defineHookProps } from "@hoci/shared"; +import type { PropType } from "vue"; + +export const configProviderProps = defineHookProps({ + src: { + type: String, + required: true + }, + size: { + type: [Number, String] + }, + width: { + type: [Number, String] + }, + height: { + type: [Number, String] + }, + color: { + type: String, + default: "currentColor" + }, + mask: { + type: [Boolean, String] as PropType, + default: () => "auto" + } +}); diff --git a/playground/src/app.vue b/playground/src/app.vue index 8779f52..a5366bd 100644 --- a/playground/src/app.vue +++ b/playground/src/app.vue @@ -1,6 +1,6 @@