Skip to content

Commit

Permalink
fix: 去除控制台警告
Browse files Browse the repository at this point in the history
  • Loading branch information
kailong321200875 committed Oct 7, 2023
1 parent de04c93 commit 4d14246
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/utils/propTypes.ts
@@ -1,11 +1,22 @@
import VueTypes, { toType } from 'vue-types'
import { CSSProperties, PropType } from 'vue'
import { VueTypeValidableDef, VueTypesInterface, createTypes, toValidableType } from 'vue-types'
import { CSSProperties } from 'vue'

class propTypes extends VueTypes {
type PropTypes = VueTypesInterface & {
readonly style: VueTypeValidableDef<CSSProperties>
}
const newPropTypes = createTypes({
func: undefined,
bool: undefined,
string: undefined,
number: undefined,
object: undefined,
integer: undefined
}) as PropTypes

class propTypes extends newPropTypes {
static get style() {
return toType('style', {
type: [String, Object] as PropType<[string | CSSProperties]>,
default: undefined
return toValidableType('style', {
type: [String, Object]
})
}
}
Expand Down

0 comments on commit 4d14246

Please sign in to comment.