8000 refactor: CBadge component refactor and check. · rmeltonmi/coreui-vue@fb17cfc · GitHub
[go: up one dir, main page]

Skip to content

Commit fb17cfc

Browse files
committed
refactor: CBadge component refactor and check.
1 parent c2f9221 commit fb17cfc

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

src/components/Badge/CBadge.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { mergeData } from 'vue-functional-data-merge'
2-
// import pluckProps from '../../utils/pluck-props'
3-
import Link, { propsFactory as linkPropsFactory } from '../Link/CLink'
4-
5-
let linkProps = linkPropsFactory()
6-
delete linkProps.href.default
7-
delete linkProps.to.default
2+
import CLink, { props as linkProps } from '../Link/CLink'
83

94
export const props = Object.assign(linkProps, {
105
tag: {
@@ -18,10 +13,6 @@ export const props = Object.assign(linkProps, {
1813
pill: {
1914
type: Boolean,
2015
default: false
21-
},
22-
additionalClasses: {
23-
type: String,
24-
default: null
2516
}
2617
})
2718

@@ -30,7 +21,7 @@ export default {
3021
name:'CBadge',
3122
props,
3223
render (h, { props, data, children }) {
33-
const tag = !props.href && !props.to ? props.tag : Link
24+
const tag = !props.href && !props.to ? props.tag : CLink
3425
const componentData = {
3526
staticClass: 'badge',
3627
class: [
@@ -39,13 +30,10 @@ export default {
3930
'badge-pill': Boolean(props.pill),
4031
active: props.active,
4132
disabled: props.disabled
42-
},
43-
props.additionalClasses? props.additionalClasses : ''
33+
}
4434
],
45-
// props: pluckProps(linkProps, props)
46-
props: props
35+
props
4736
}
48-
4937
return h(tag, mergeData(data, componentData), children)
5038
}
5139
}

0 commit comments

Comments
 (0)
0