4cd4fd28
郭伟龙
feat: 初始化项目
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
import { extend, mergeData } from '../../vue'
import { NAME_CARD_TITLE } from '../../constants/components'
import { PROP_TYPE_STRING } from '../../constants/props'
import { makeProp, makePropsConfigurable } from '../../utils/props'
import { toString } from '../../utils/string'
// --- Props ---
export const props = makePropsConfigurable(
{
title: makeProp(PROP_TYPE_STRING),
titleTag: makeProp(PROP_TYPE_STRING, 'h4')
},
NAME_CARD_TITLE
)
// --- Main component ---
// @vue/component
export const BCardTitle = /*#__PURE__*/ extend({
name: NAME_CARD_TITLE,
functional: true,
props,
render(h, { props, data, children }) {
return h(
props.titleTag,
mergeData(data, {
staticClass: 'card-title'
}),
children || toString(props.title)
)
}
})
|