mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
[improvement] declare functional sfc (#2695)
This commit is contained in:
@@ -2,21 +2,20 @@ import { use, isDef } from '../utils';
|
||||
|
||||
const [sfc, bem] = use('info');
|
||||
|
||||
export default sfc(
|
||||
{
|
||||
props: {
|
||||
info: [String, Number]
|
||||
},
|
||||
export default sfc({
|
||||
functional: true,
|
||||
|
||||
render(h, { props, data }) {
|
||||
return (
|
||||
isDef(props.info) && (
|
||||
<div class={bem()} {...data}>
|
||||
{props.info}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
props: {
|
||||
info: [String, Number]
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
render(h, { props, data }) {
|
||||
return (
|
||||
isDef(props.info) && (
|
||||
<div class={bem()} {...data}>
|
||||
{props.info}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user