fix(Layout): outside of the screen after setting gutter (#6143)

This commit is contained in:
neverland
2020-04-27 10:49:24 +08:00
committed by GitHub
parent 0786779842
commit a460425b26
5 changed files with 54 additions and 31 deletions
+3 -5
View File
@@ -1,8 +1,11 @@
import { createNamespace } from '../utils';
import { ParentMixin } from '../mixins/relation';
const [createComponent, bem] = createNamespace('row');
export default createComponent({
mixins: [ParentMixin('vanRow')],
props: {
type: String,
align: String,
@@ -26,14 +29,9 @@ export default createComponent({
render() {
const { align, justify } = this;
const flex = this.type === 'flex';
const margin = `-${Number(this.gutter) / 2}px`;
const style = this.gutter
? { marginLeft: margin, marginRight: margin }
: {};
return (
<this.tag
style={style}
class={bem({
flex,
[`align-${align}`]: flex && align,