Skip to content

Commit c7da5fe

Browse files
committed
feat: 导出类和样式
1 parent 88d311f commit c7da5fe

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

example/module/basic/simple-component/index.view.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { defineComponent, useClassAndStyle } from 'vue3-oop'
2-
import { AllowedComponentProps } from '@/type'
2+
import { ClassAndStyleProps } from '@/type'
33
import { ref } from 'vue'
44

55
// region 函数组件
6-
export interface SimpleFuncComponentProps extends AllowedComponentProps {
6+
export interface SimpleFuncComponentProps extends ClassAndStyleProps {
77
count?: number
88
}
99
export function SimpleFuncComponent(props: SimpleFuncComponentProps) {

src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ export type {
2828
WithVModel,
2929
ComponentPropsObject,
3030
Hanlder,
31+
ClassAndStyleProps,
3132
} from './type'

src/type.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export type ComponentSlots<T extends { props: any }> = NonNullable<
7373
/** 为了阻止ts把不相关的类也解析到metadata数据中,用这个工具类型包装一下类 */
7474
export type ClassType<T> = T
7575

76-
export type AllowedComponentProps = {
76+
export type ClassAndStyleProps = {
7777
class?: any
7878
style?: StyleValue
7979
[name: string]: any
@@ -90,5 +90,5 @@ export type VueComponentProps<T extends {}> = DistributiveOmit<T, 'slots'> &
9090
DistributiveVModel<T> &
9191
DistributiveVSlots<T> &
9292
VNodeProps &
93-
AllowedComponentProps &
93+
ClassAndStyleProps &
9494
ComponentCustomProps

0 commit comments

Comments
 (0)