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

更新font-family示例

上级 adeee95b
...@@ -3,16 +3,33 @@ ...@@ -3,16 +3,33 @@
<view style="height: 500rpx;background-color: gray;justify-content: center;align-items: center;"> <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: monospace;">font-family: monospace</text>
<text class="common" style="font-family: cursive;">font-family: cursive</text> <text class="common" style="font-family: cursive;">font-family: cursive</text>
<text class="common" style="font-family: AlimamaDaoLiTi;">font-family: 阿里妈妈刀隶体</text>
</view> </view>
</view> </view>
</template> </template>
<script> <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> </script>
<style> <style>
.common { .common {
font-size: 20px; font-size: 20px;
line-height: 40px;
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册