Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/grid/layout #1012

Merged
merged 3 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions src/action-sheet/_example/grid-multi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,99 +9,99 @@ Component({
context: this,
items: [
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
],
Expand Down
16 changes: 8 additions & 8 deletions src/action-sheet/_example/grid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,35 @@ Component({
context: this,
items: [
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
{
label: '文字',
label: '标题文字',
icon: 'image',
},
],
Expand Down
8 changes: 6 additions & 2 deletions src/action-sheet/template/action-sheet-grid.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
wx:key="index"
bind:tap="onSelect"
data-index="{{index}}"
icon="{{item.icon}}"
text="{{item.label}}"
>
<template is="item" data="{{classPrefix, item}}" />
<!-- <template is="item" data="{{classPrefix, item}}" /> -->
</t-grid-item>
</t-grid>
</block>
Expand All @@ -26,8 +28,10 @@
wx:key="index"
data-index="{{index}}"
bind:tap="onSelect"
icon="{{item.icon}}"
text="{{item.label}}"
>
<template is="item" data="{{classPrefix, item}}" />
<!-- <template is="item" data="{{classPrefix, item}}" /> -->
</t-grid-item>
</t-grid>
</t-swiper-item>
Expand Down
50 changes: 0 additions & 50 deletions src/grid/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,6 @@ exports[`grid :base 1`] = `
class="t-grid-item__content t-grid-item__content--center t-grid-item__content--vertical t-class-content"
style=""
>
<t-badge
tClass=""
tClassContent=""
tClassCount=""
>
<wx-view
class="t-badge t-class"
style=""
>
<wx-view
class="t-badge__content t-class-content"
>
<wx-view
class="t-grid-item__image t-grid-item__image--middle t-class-image"
/>
</wx-view>
<wx-view
class="t-badge--basic t-badge--circle t-has-count t-class-count"
style=""
>


</wx-view>
</wx-view>
</t-badge>
<wx-view
class="t-grid-item__words t-grid-item__words--vertical"
/>
Expand All @@ -80,31 +55,6 @@ exports[`grid :base 1`] = `
class="t-grid-item__content t-grid-item__content--center t-grid-item__content--vertical t-class-content"
style=""
>
<t-badge
tClass=""
tClassContent=""
tClassCount=""
>
<wx-view
class="t-badge t-class"
style=""
>
<wx-view
class="t-badge__content t-class-content"
>
<wx-view
class="t-grid-item__image t-grid-item__image--middle t-class-image"
/>
</wx-view>
<wx-view
class="t-badge--basic t-badge--circle t-has-count t-class-count"
style=""
>


</wx-view>
</wx-view>
</t-badge>
<wx-view
class="t-grid-item__words t-grid-item__words--vertical"
/>
Expand Down
5 changes: 5 additions & 0 deletions src/grid/grid-item.less
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
height: 100%;
// float: left;
display: inline-block;
vertical-align: top;

&--hover {
background-color: var(--td-grid-item-hover-bg-color, @grid-item-hover-bg-color);
Expand Down Expand Up @@ -60,6 +61,10 @@
&--horizontal {
margin-left: 24rpx;
}

&:empty {
display: none;
}
}

&__image {
Expand Down
1 change: 1 addition & 0 deletions src/grid/grid-item.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
>
<slot />
<t-badge
wx:if="{{image || icon}}"
color="{{badgeProps.color}}"
content="{{badgeProps.content}}"
count="{{badgeProps.count}}"
Expand Down