Skip to content

Commit 547a617

Browse files
committed
fix: fix sm screens flex bug
1 parent da9157d commit 547a617

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

packages/site/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<TheHeader />
33
<Bg />
4-
<main class="w-85% ma h-[calc(100%-4rem)]">
4+
<main class="w-85% ma mb-6 sm:h-[calc(100%-4rem)]">
55
<router-view />
66
</main>
77
</template>

packages/site/src/pages/home/index.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<script setup lang="ts">
2+
import { breakpointsTailwind } from '@vueuse/core'
23
import { ElNotification } from 'element-plus'
34
import { JSON_TSC } from 'json-tsc'
45
import { example1, example2 } from '../../constants'
56
67
const inputCode = ref('')
78
const outputCode = ref('')
9+
const smallerThanSM = useBreakpoints(breakpointsTailwind).smaller('sm')
810
const configModel = reactive({
911
prependWithO: true,
1012
sortAlphabetically: false,
@@ -90,8 +92,8 @@ const handleReset = () => {
9092
</script>
9193

9294
<template>
93-
<div flex flex-wrap w-full h-full>
94-
<div m-r-20px m-b-20px w-80>
95+
<div flex w-full h-full :class="smallerThanSM && 'flex-wrap'">
96+
<div m-r-20px m-b-20px w-80 :class="smallerThanSM && 'w-full !m-r-0'">
9597
<el-card h-full class="card-style">
9698
<template #header>
9799
<div class="card-header flex flex-col items-start space-y-2">
@@ -154,7 +156,7 @@ const handleReset = () => {
154156
<div h-90>
155157
<el-input v-model="inputCode" type="textarea" :placeholder="t('textarea.inputCode')" />
156158
</div>
157-
<div flex-1 min-h-40>
159+
<div :class="smallerThanSM ? 'h-90' : 'flex-1'">
158160
<el-input v-model="outputCode" type="textarea" :placeholder="t('textarea.outputCode')" />
159161
</div>
160162
</div>

packages/site/unocss.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {
88
} from 'unocss'
99

1010
export default defineConfig({
11+
theme: {
12+
},
1113
shortcuts: [
1214
['btn', 'px-4 py-1 rounded inline-block bg-teal-600 text-white cursor-pointer hover:bg-teal-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'],
1315
['icon-btn', 'text-[0.9em] inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600'],

0 commit comments

Comments
 (0)