mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[improvement] CellGroup: jsx (#2769)
This commit is contained in:
parent
1d84d33264
commit
82b29267a2
@ -1,9 +1,17 @@
|
||||
import { use } from '../utils';
|
||||
import { inherit } from '../utils/functional';
|
||||
|
||||
// Types
|
||||
import { FunctionalComponent } from '../utils/use/sfc';
|
||||
|
||||
const [sfc, bem] = use('cell-group');
|
||||
|
||||
function CellGroup(h, props, slots, ctx) {
|
||||
const CellGroup: FunctionalComponent<CellGroupProps> = function (
|
||||
h,
|
||||
props,
|
||||
slots,
|
||||
ctx
|
||||
) {
|
||||
return (
|
||||
<div
|
||||
class={[bem(), { 'van-hairline--top-bottom': props.border }]}
|
||||
@ -12,7 +20,11 @@ function CellGroup(h, props, slots, ctx) {
|
||||
{slots.default && slots.default()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export type CellGroupProps = {
|
||||
border?: boolean
|
||||
};
|
||||
|
||||
CellGroup.props = {
|
||||
border: {
|
@ -46,6 +46,12 @@ const Loading: FunctionalComponent<LoadingProps> = function(
|
||||
);
|
||||
};
|
||||
|
||||
export type LoadingProps = {
|
||||
size?: string;
|
||||
type?: string;
|
||||
color?: string;
|
||||
};
|
||||
|
||||
Loading.props = {
|
||||
size: String,
|
||||
type: {
|
||||
@ -58,10 +64,4 @@ Loading.props = {
|
||||
}
|
||||
};
|
||||
|
||||
export type LoadingProps = {
|
||||
size?: string;
|
||||
type?: string;
|
||||
color?: string;
|
||||
};
|
||||
|
||||
export default sfc<LoadingProps>(Loading);
|
||||
|
Loading…
x
Reference in New Issue
Block a user