Skip to content

Commit

Permalink
feat(grid): add folder && file
Browse files Browse the repository at this point in the history
  • Loading branch information
SzHeJason committed Jul 25, 2018
1 parent 28de062 commit 5a4d25f
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class App extends Component {
'pages/view/tag/index',
'pages/view/avatar/index',
'pages/view/article/index',
'pages/layout/flex/index'
'pages/layout/flex/index',
'pages/layout/grid/index'
],
window: {
backgroundTextStyle: 'light',
Expand Down
15 changes: 15 additions & 0 deletions src/components/grid/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Taro from '@tarojs/taro'
import { View } from '@tarojs/components'

import AtGridItem from './item/index'

import './index.scss'

export default class AtGrid extends Taro.Component {
static Item = AtGridItem

render () {
const { children } = this.props
return <View className='at-grid'>{children}</View>
}
}
Empty file added src/components/grid/index.scss
Empty file.
12 changes: 12 additions & 0 deletions src/components/grid/item/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Taro from '@tarojs/taro'

import { View } from '@tarojs/components'

import './index.scss'

export default class AtGridItem extends Taro.Component {
render () {
const { children } = this.props
return <View className='at-grid-item'>{children}</View>
}
}
Empty file.
30 changes: 30 additions & 0 deletions src/pages/layout/grid/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* eslint taro/custom-component-children: 0 */
import Taro from '@tarojs/taro'
import { View, Text } from '@tarojs/components'

import AtGrid from '../../../components/grid/index'

import './index.scss'

export default class GridPage extends Taro.Component {
config = {
navigationBarTitleText: 'Grid Page'
}

render () {
return (
<View className='grid__page'>
<View className='example'>
<View className='example__header'>
<Text className='example__header-title'>基本案例</Text>
</View>
<View className='example__body'>
<AtGrid mode='square'>
<AtGrid.Item />
</AtGrid>
</View>
</View>
</View>
)
}
}
Empty file.

0 comments on commit 5a4d25f

Please sign in to comment.