Skip to content

Commit

Permalink
fix(字体列表): 本地字体展示名称
Browse files Browse the repository at this point in the history
  • Loading branch information
nihaojob committed Apr 23, 2023
1 parent 864be03 commit ebafe8b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/attribute.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<div class="left font-selector">
<Select v-model="fontAttr.fontFamily" @on-change="changeFontFamily">
<Option v-for="item in fontFamilyList" :value="item.name" :key="'font-' + item.name">
<div class="font-item" :style="`background-image:url('${item.preview}');`"></div>
<div class="font-item" :style="`background-image:url('${item.preview}');`">
{{ !item.preview ? item : '' }}
</div>
</Option>
</Select>
</div>
Expand Down Expand Up @@ -508,7 +510,10 @@ export default {
},
getFreeFontList() {
axios.get(repoSrc + '/font/free-font.json').then((res) => {
this.fontFamilyList = Object.entries(res.data).map(([, value]) => value);
this.fontFamilyList = [
...this.fontFamilyList,
...Object.entries(res.data).map(([, value]) => value),
];
});
},
// 通用属性改变
Expand Down Expand Up @@ -731,6 +736,9 @@ export default {
background-position: center center;
height: 40px;
width: 200px;
color: #fff;
font-size: 27px;
text-align: center;
filter: invert(100%);
}
}
Expand Down

0 comments on commit ebafe8b

Please sign in to comment.