[improvement] CellGroup: jsx (#2769)

This commit is contained in:
neverland 2019-02-17 18:23:48 +08:00 committed by GitHub
parent 1d84d33264
commit 82b29267a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 8 deletions

View File

@ -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: {

View File

@ -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);