feat(admin): display a column on the mobile

This commit is contained in:
dntzhang 2021-08-04 07:40:42 +08:00
parent d99eb38f4b
commit 45b5e6ab97
2 changed files with 16 additions and 4 deletions

View File

@ -19,13 +19,28 @@ declare global {
export default class extends WeElement<Props> {
static css = null
columnCount = 2
installed() {
window.addEventListener('resize', this.onResize)
}
uninstall() {
window.removeEventListener('resize', this.onResize)
}
onResize = () => {
this.columnCount = window.innerWidth < 768 ? 1 : 2
this.updateSelf()
}
render(props: Props) {
return (
<div
class={props.class}
style={Object.assign(
{
columnCount: 2,
columnCount: this.columnCount,
columnGap: '1rem',
padding: '1rem'
},

View File

@ -230,9 +230,6 @@ class Store {
icon: 'ac-unit-outlined',
href: '#/slider-component'
}
=======
]
},
{