Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit69a05dd

Browse files
committed
refactor: update shared props types handling
1 parente0239fd commit69a05dd

File tree

6 files changed

+22
-15
lines changed

6 files changed

+22
-15
lines changed

‎packages/coreui-vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@
6262
"vue-types":"^5.1.3"
6363
},
6464
"peerDependencies": {
65-
"vue":"^3.2.21"
65+
"vue":"^3.5.0"
6666
}
6767
}

‎packages/coreui-vue/src/components/form/CFormControlWrapper.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { CFormFloating } from './CFormFloating'
44
import{CFormLabel}from'./CFormLabel'
55
import{CFormText}from'./CFormText'
66

7-
typeCFormControlValidationProps=InstanceType<typeofCFormControlValidation>['$props']
7+
importtype{ComponentProps}from'../../utils/ComponentProps'
88

9-
interfaceCFormControlWrapperProps{
9+
interfaceCFormControlWrapperPropsextendsComponentProps<typeofCFormControlValidation>{
1010
floatingLabel?:string
1111
id?:string
1212
label?:string
@@ -27,7 +27,9 @@ const CFormControlWrapper = defineComponent({
2727
/**
2828
*@ignore
2929
*/
30-
id:String,
30+
id:{
31+
type:String,
32+
},
3133
/**
3234
* Add a caption for a component.
3335
*
@@ -41,7 +43,7 @@ const CFormControlWrapper = defineComponent({
4143
*/
4244
text:String,
4345
},
44-
setup(props:CFormControlWrapperProps&CFormControlValidationProps,{ slots}){
46+
setup(props:CFormControlWrapperProps,{ slots}){
4547
constformControlValidation=()=>
4648
h(
4749
CFormControlValidation,
@@ -50,7 +52,6 @@ const CFormControlWrapper = defineComponent({
5052
feedback:props.feedback,
5153
feedbackInvalid:props.feedbackInvalid,
5254
feedbackValid:props.feedbackValid,
53-
floatingLabel:props.floatingLabel,
5455
invalid:props.invalid,
5556
tooltipFeedback:props.tooltipFeedback,
5657
valid:props.valid,

‎packages/coreui-vue/src/components/nav/CNavItem.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import{defineComponent,h}from'vue'
2-
32
import{CNavLink}from'./CNavLink'
43

5-
typeCNavLinkProps=Omit<InstanceType<typeofCNavLink>['$props'],'as'>
4+
importtype{ComponentProps}from'../../utils/ComponentProps'
65

7-
interfaceCNavItemProps{
6+
interfaceCNavItemPropsextendsComponentProps<typeofCNavLink>{
87
as:string
98
}
109

@@ -20,7 +19,7 @@ const CNavItem = defineComponent({
2019
default:'li',
2120
},
2221
},
23-
setup(props:CNavLinkProps&CNavItemProps,{ slots}){
22+
setup(props:CNavItemProps,{ slots}){
2423
return()=>
2524
h(
2625
props.as,

‎packages/coreui-vue/src/components/toast/CToastClose.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import{defineComponent,h,inject,resolveComponent}from'vue'
22
import{CCloseButton}from'../close-button/CCloseButton'
33

4-
typeCCloseButtonProps=InstanceType<typeofCCloseButton>['$props']
4+
importtype{ComponentProps}from'../../utils/ComponentProps'
55

6-
interfaceCToastCloseProps{
7-
as:string
6+
interfaceCCloseButtonPropsextendsComponentProps<typeofCCloseButton>{
7+
as?:string
88
}
99

1010
constCToastClose=defineComponent({
@@ -22,7 +22,7 @@ const CToastClose = defineComponent({
2222
*/
2323
'close',
2424
],
25-
setup(props:CToastCloseProps&CCloseButtonProps,{ slots, emit}){
25+
setup(props:CCloseButtonProps,{ slots, emit}){
2626
// eslint-disable-next-line no-unused-vars
2727
constupdateVisible=inject('updateVisible')as(visible:boolean)=>void
2828
consthandleClose=()=>{
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import{DefineComponent,ExtractPropTypes,ExtractPublicPropTypes}from'vue'
2+
3+
exporttypeComponentProps<T>=
4+
TextendsDefineComponent<ExtractPropTypes<inferProps>,any,any>
5+
?ExtractPublicPropTypes<Props>
6+
:never

‎packages/docs/build/docgen.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ module.exports = {
88
components:[
99
'**/[A-Z]*.ts',
1010
'!**/[A-Z]*.d.ts',
11-
'!**/[A-Z]*.spec.ts'
11+
'!**/[A-Z]*.spec.ts',
12+
'!**/ComponentProps.ts',
1213
],
1314
outDir:'api',// folder to save components docs in (relative to the current working directry)
1415
getDocFileName:(componentPath)=>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp