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