UI优化
This commit is contained in:
@@ -13,6 +13,14 @@ const props = defineProps({
|
|||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
margin: {
|
||||||
|
type: Number,
|
||||||
|
default: 4,
|
||||||
|
},
|
||||||
|
fontSize: {
|
||||||
|
type: Number,
|
||||||
|
default: 25,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const items = ref(new Array(props.total).fill(9));
|
const items = ref(new Array(props.total).fill(9));
|
||||||
watch(
|
watch(
|
||||||
@@ -28,7 +36,12 @@ watch(
|
|||||||
v-for="(_, index) in items"
|
v-for="(_, index) in items"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="score-item"
|
class="score-item"
|
||||||
:style="{ width: 90 / rowCount + 'vw', height: 90 / rowCount + 'vw' }"
|
:style="{
|
||||||
|
width: 100 / (rowCount + 2) + 'vw',
|
||||||
|
height: 100 / (rowCount + 2) + 'vw',
|
||||||
|
fontSize: fontSize + 'px',
|
||||||
|
margin: margin + 'px',
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
{{ scores[index] }}
|
{{ scores[index] }}
|
||||||
</view>
|
</view>
|
||||||
@@ -40,7 +53,7 @@ watch(
|
|||||||
width: 90vw;
|
width: 90vw;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: flex-start;
|
justify-content: center;
|
||||||
margin: 0 5vw;
|
margin: 0 5vw;
|
||||||
}
|
}
|
||||||
.score-item {
|
.score-item {
|
||||||
@@ -52,6 +65,5 @@ watch(
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 20px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ onUnmounted(() => {
|
|||||||
:scores="scores.map((s) => s.ring)"
|
:scores="scores.map((s) => s.ring)"
|
||||||
:total="total"
|
:total="total"
|
||||||
:rowCount="total / 4"
|
:rowCount="total / 4"
|
||||||
|
:margin="1.5"
|
||||||
|
:font-size="20"
|
||||||
/>
|
/>
|
||||||
<ScoreResult
|
<ScoreResult
|
||||||
:total="total"
|
:total="total"
|
||||||
|
|||||||
Reference in New Issue
Block a user