换ubuntu
This commit is contained in:
2
utils/dist/row/index.d.ts
vendored
2
utils/dist/row/index.d.ts
vendored
@@ -1 +1 @@
|
||||
export {};
|
||||
export {};
|
||||
|
||||
72
utils/dist/row/index.js
vendored
72
utils/dist/row/index.js
vendored
@@ -1,36 +1,36 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
VantComponent({
|
||||
relation: {
|
||||
name: 'col',
|
||||
type: 'descendant',
|
||||
linked(target) {
|
||||
if (this.data.gutter) {
|
||||
target.setGutter(this.data.gutter);
|
||||
}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
gutter: Number
|
||||
},
|
||||
watch: {
|
||||
gutter: 'setGutter'
|
||||
},
|
||||
mounted() {
|
||||
if (this.data.gutter) {
|
||||
this.setGutter();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setGutter() {
|
||||
const { gutter } = this.data;
|
||||
const margin = `-${Number(gutter) / 2}px`;
|
||||
const style = gutter
|
||||
? `margin-right: ${margin}; margin-left: ${margin};`
|
||||
: '';
|
||||
this.setData({ style });
|
||||
this.getRelationNodes('../col/index').forEach(col => {
|
||||
col.setGutter(this.data.gutter);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
import { VantComponent } from '../common/component';
|
||||
VantComponent({
|
||||
relation: {
|
||||
name: 'col',
|
||||
type: 'descendant',
|
||||
linked(target) {
|
||||
if (this.data.gutter) {
|
||||
target.setGutter(this.data.gutter);
|
||||
}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
gutter: Number
|
||||
},
|
||||
watch: {
|
||||
gutter: 'setGutter'
|
||||
},
|
||||
mounted() {
|
||||
if (this.data.gutter) {
|
||||
this.setGutter();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setGutter() {
|
||||
const { gutter } = this.data;
|
||||
const margin = `-${Number(gutter) / 2}px`;
|
||||
const style = gutter
|
||||
? `margin-right: ${margin}; margin-left: ${margin};`
|
||||
: '';
|
||||
this.setData({ style });
|
||||
this.getRelationNodes('../col/index').forEach(col => {
|
||||
col.setGutter(this.data.gutter);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
6
utils/dist/row/index.json
vendored
6
utils/dist/row/index.json
vendored
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
|
||||
6
utils/dist/row/index.wxml
vendored
6
utils/dist/row/index.wxml
vendored
@@ -1,3 +1,3 @@
|
||||
<view class="custom-class van-row" style="{{ style }}">
|
||||
<slot />
|
||||
</view>
|
||||
<view class="custom-class van-row" style="{{ style }}">
|
||||
<slot />
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user