Skip to content

Commit a462d1d

Browse files
committed
feat: 优化部分代码
1 parent 72f33d2 commit a462d1d

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

frontend/src/App.vue

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<div class="item">
4949
<div class="label">主题样式</div>
5050
<div class="value">
51-
<el-select v-model="like.theme" style="width: 150px" size="small">
51+
<el-select v-model="like.theme" size="small">
5252
<el-option
5353
v-for="item in THEME_OPTIONS"
5454
:key="item.value"
@@ -62,7 +62,7 @@
6262
<div class="item">
6363
<div class="label">字体大小</div>
6464
<div class="value">
65-
<el-input-number v-model="like.fontSize" :min="8" :max="100" />
65+
<el-input-number v-model="like.fontSize" :min="8" :max="100" size="small" />
6666
</div>
6767
</div>
6868
</div>
@@ -100,8 +100,11 @@ const editorRef = ref<any[]>([])
100100
html,
101101
body,
102102
#app {
103-
position: relative;
104103
height: 100%;
104+
}
105+
106+
#app {
107+
position: relative;
105108
106109
> .view {
107110
height: 100%;
@@ -183,16 +186,20 @@ body,
183186
> .item {
184187
display: flex;
185188
align-items: center;
186-
gap: 12px;
189+
gap: 16px;
187190
188191
> .label {
189192
font-size: 14px;
190193
line-height: 24px;
191-
width: 100px;
194+
width: 70px;
192195
}
193196
194197
> .value {
195198
flex: 1;
199+
200+
> * {
201+
width: 100%;
202+
}
196203
}
197204
}
198205
}

frontend/src/hooks/useLike.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const key = 'like_v1'
2020
export default function useCode() {
2121
const open = ref(false)
2222

23-
const like = reactive<LikeModel>(localStorage.get(key) || defLike)
23+
const like = reactive<LikeModel>(Object.assign(defLike, localStorage.get(key)))
2424

2525
watch(like, () => {
2626
localStorage.set(key, toRaw(like))

0 commit comments

Comments
 (0)