提交 f04f064a 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新font-family示例

上级 adeee95b
......@@ -3,16 +3,33 @@
<view style="height: 500rpx;background-color: gray;justify-content: center;align-items: center;">
<text class="common" style="font-family: monospace;">font-family: monospace</text>
<text class="common" style="font-family: cursive;">font-family: cursive</text>
<text class="common" style="font-family: AlimamaDaoLiTi;">font-family: 阿里妈妈刀隶体</text>
</view>
</view>
</template>
<script>
export default {
onLoad() {
// 加载网络字体
uni.loadFontFace({
global: false,
source: "https://native-res.dcloud.net.cn/uni-app-x/static/font/AlimamaDaoLiTi.ttf",
family: "AlimamaDaoLiTi",
success(res) {
console.log(JSON.stringify(res));
},
fail(err) {
console.error(JSON.stringify(err));
}
});
}
}
</script>
<style>
.common {
font-size: 20px;
line-height: 40px;
}
</style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册