-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 更新 skeleton 的 axml * feat: 更新 skeleton 的 axml * fix: remove comments * feat: 更新 skeleton page 的 demo * fix: 删除多余的括号 * fix: 删除了多余的 classname --------- Co-authored-by: DiamondYuan <fandi.yfd@antgroup.com>
- Loading branch information
1 parent
b6fb1ed
commit 7af1864
Showing
35 changed files
with
356 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
Page({ | ||
data: { | ||
showLoading: true, | ||
paragraph: { | ||
rows: 4, | ||
data: { | ||
showLoading: true, | ||
paragraph: { | ||
rows: 4, | ||
}, | ||
}, | ||
handleToggleShowLoading() { | ||
this.setData({ showLoading: !this.data.showLoading }); | ||
}, | ||
}, | ||
handleToggleShowLoading() { | ||
this.setData({ showLoading: !this.data.showLoading }); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
function getClass(size) { | ||
const list = ['x-small', 'small', 'medium', 'large']; | ||
if (list.indexOf(size) >=0) { | ||
return `ant-skeleton-avatar-${size}`; | ||
var list = ['x-small', 'small', 'medium', 'large']; | ||
if (list.indexOf(size) >= 0) { | ||
return "ant-skeleton-avatar-".concat(size); | ||
} | ||
return 'ant-skeleton-avatar-medium'; | ||
} | ||
|
||
export default { getClass }; | ||
export default { | ||
getClass: getClass | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
function getClass(size) { | ||
const list = ['small', 'medium', 'large']; | ||
if (list.indexOf(size) >=0) { | ||
return `ant-skeleton-button-${size}`; | ||
var list = ['small', 'medium', 'large']; | ||
if (list.indexOf(size) >= 0) { | ||
return "ant-skeleton-button-".concat(size); | ||
} | ||
return 'ant-skeleton-button-medium'; | ||
} | ||
|
||
export default { getClass }; | ||
export default { | ||
getClass: getClass | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<view | ||
a:if="{{loading}}" | ||
class="ant-skeleton-input {{animate?'ant-skeleton-input-animate':''}} {{className||''}}" | ||
style="{{style}}"></view> | ||
a:if="{{ loading }}" | ||
class="ant-skeleton-input {{ animate ? 'ant-skeleton-input-animate' : '' }} {{ className || '' }}" | ||
style="{{ style }}" /> | ||
<slot a:else /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
<view | ||
a:if="{{loading && rows > 0}}" | ||
class="ant-skeleton-paragraph {{animate?'ant-skeleton-paragraph-animate':''}} {{className||''}}" | ||
style="{{style}}"> | ||
<view | ||
class="ant-skeleton-paragraph-row" | ||
a:for="{{rows}}"></view> | ||
a:if="{{ loading && rows > 0 }}" | ||
class="ant-skeleton-paragraph {{ animate ? 'ant-skeleton-paragraph-animate' : '' }} {{ className || '' }}" | ||
style="{{ style }}"> | ||
<block | ||
a:for="{{ rows }}" | ||
a:for-index="index" | ||
a:for-item="item"> | ||
<view class="ant-skeleton-paragraph-row" /> | ||
</block> | ||
</view> | ||
<slot a:else /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<view | ||
a:if="{{loading}}" | ||
class="ant-skeleton-title {{animate?'ant-skeleton-title-animate':''}} {{className||''}}" | ||
style="{{style}}"></view> | ||
a:if="{{ loading }}" | ||
class="ant-skeleton-title {{ animate ? 'ant-skeleton-title-animate' : '' }} {{ className || '' }}" | ||
style="{{ style }}" /> | ||
<slot a:else /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { Page, View } from 'tsxml'; | ||
import Avatar from '../../../src/Avatar/index.axml'; | ||
import Container from '../../../src/Container/index.axml'; | ||
import SkeletonAvatar from '../../../src/Skeleton/Avatar/index.axml'; | ||
import SkeletonButton from '../../../src/Skeleton/Button/index.axml'; | ||
import Skeleton from '../../../src/Skeleton/index.axml'; | ||
import SkeletonInput from '../../../src/Skeleton/Input/index.axml'; | ||
import SkeletonParagraph from '../../../src/Skeleton/Paragraph/index.axml'; | ||
import Switch from '../../../src/Switch/index.axml'; | ||
|
||
export default ({ showLoading, paragraph }) => ( | ||
<Page> | ||
<Container title="基础用法"> | ||
<Skeleton /> | ||
</Container> | ||
|
||
<Container title="有动画的骨架屏"> | ||
<Skeleton animate={true} /> | ||
</Container> | ||
|
||
<Container title="带avatar"> | ||
<Skeleton avatar={true} /> | ||
</Container> | ||
|
||
<Container title="自定义组合"> | ||
<View class="list"> | ||
<SkeletonAvatar className="custom" /> | ||
<SkeletonParagraph className="custom" rows={1} /> | ||
<SkeletonInput className="custom" /> | ||
<SkeletonInput className="custom" /> | ||
<SkeletonInput className="custom" /> | ||
<SkeletonButton className="custom" size="small" /> | ||
</View> | ||
</Container> | ||
|
||
<Container title="复杂组合"> | ||
<Skeleton | ||
loading={showLoading} | ||
title={false} | ||
avatar={true} | ||
paragraph={paragraph} | ||
> | ||
<View class="container"> | ||
<Avatar src="https://images.unsplash.com/photo-1546967191-fdfb13ed6b1e?ixlib=rb-1.2.1&q=80&fm=jpg&crop=faces&fit=crop&h=200&w=200&ixid=eyJhcHBfaWQiOjE3Nzg0fQ" /> | ||
<View class="content"> | ||
We supply a series of design principles, practical patterns and high | ||
quality design resources, to help people create their product | ||
prototypes beautifully and efficiently. | ||
</View> | ||
</View> | ||
</Skeleton> | ||
<View slot="headerRight"> | ||
显示骨架 | ||
<Switch | ||
style="margin-left: 8px" | ||
checked={showLoading} | ||
onChange="handleToggleShowLoading" | ||
/> | ||
</View> | ||
</Container> | ||
</Page> | ||
); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { $toArray, View } from 'tsxml'; | ||
import Component from './component'; | ||
|
||
export default ({ row }: { row: number }) => ( | ||
<Component> | ||
{$toArray(row).map((_, index) => ( | ||
<View>{index}</View> | ||
))} | ||
</Component> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<block | ||
a:for="{{ row }}" | ||
a:for-index="index" | ||
a:for-item="_"> | ||
<view>{{ index }}</view> | ||
</block> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<block | ||
wx:for="{{ row }}" | ||
wx:for-index="index" | ||
wx:for-item="_"> | ||
<view>{{ index }}</view> | ||
</block> |
Oops, something went wrong.