taro-skeleton-screen
v0.2.6
Published
基于Taro的骨架屏插件
Downloads
80
Maintainers
Readme
taro-skeleton-screen
一个基于taro-skeleton做了webpack5 、Taro3.6以上版本的兼容处理
支持多端平台使用
- 微信小程序
- h5
- 百度小程序
- 头条小程序
- 支付宝小程序
使用方式
导入组件
import Skeleton from 'taro-skeleton-screen'
导入样式
import 'taro-skeleton-screen/style/taroskeleton.css'
基础用法
通过title
属性显示标题占位图,通过row
属性配置占位段落行数
<Skeleton title row={3} />
<Skeleton
title
avatar
row={3}
loading={loading}
>
<Text>实际内容</Text>
</Skeleton>
export default class Index extends Component {
state = {
loading: false
}
render () {
return (
<View className='index'>
<Skeleton loading={this.state.loading} title avatar row={2} action></Skeleton>
</View>
)
}
}