Skip to content

Commit

Permalink
feat: 导出类和样式
Browse files Browse the repository at this point in the history
  • Loading branch information
agileago committed Nov 25, 2024
1 parent 88d311f commit c7da5fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions example/module/basic/simple-component/index.view.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineComponent, useClassAndStyle } from 'vue3-oop'
import { AllowedComponentProps } from '@/type'
import { ClassAndStyleProps } from '@/type'
import { ref } from 'vue'

// region 函数组件
export interface SimpleFuncComponentProps extends AllowedComponentProps {
export interface SimpleFuncComponentProps extends ClassAndStyleProps {
count?: number
}
export function SimpleFuncComponent(props: SimpleFuncComponentProps) {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ export type {
WithVModel,
ComponentPropsObject,
Hanlder,
ClassAndStyleProps,
} from './type'
4 changes: 2 additions & 2 deletions src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export type ComponentSlots<T extends { props: any }> = NonNullable<
/** 为了阻止ts把不相关的类也解析到metadata数据中,用这个工具类型包装一下类 */
export type ClassType<T> = T

export type AllowedComponentProps = {
export type ClassAndStyleProps = {
class?: any
style?: StyleValue
[name: string]: any
Expand All @@ -90,5 +90,5 @@ export type VueComponentProps<T extends {}> = DistributiveOmit<T, 'slots'> &
DistributiveVModel<T> &
DistributiveVSlots<T> &
VNodeProps &
AllowedComponentProps &
ClassAndStyleProps &
ComponentCustomProps

0 comments on commit c7da5fe

Please sign in to comment.