refactor(Layout): enable flex by default, remove type prop

This commit is contained in:
chenjiahan
2020-10-06 17:29:02 +08:00
parent e9c2821235
commit f7a1208a18
6 changed files with 27 additions and 65 deletions
+1 -13
View File
@@ -1,19 +1,7 @@
@import '../style/var';
.van-row {
&::after {
display: table;
clear: both;
content: '';
}
&--flex {
display: flex;
&::after {
display: none;
}
}
display: flex;
&--justify-center {
justify-content: center;
+3 -7
View File
@@ -23,7 +23,6 @@ export type RowJustify =
export default createComponent({
props: {
type: String as PropType<'flex'>,
align: String as PropType<RowAlign>,
justify: String as PropType<RowJustify>,
tag: {
@@ -87,15 +86,12 @@ export default createComponent({
linkChildren({ spaces });
return () => {
const { tag, type, align, justify } = props;
const flex = type === 'flex';
const { tag, align, justify } = props;
return (
<tag
class={bem({
flex,
[`align-${align}`]: flex && align,
[`justify-${justify}`]: flex && justify,
[`align-${align}`]: align,
[`justify-${justify}`]: justify,
})}
>
{slots.default?.()}