引入官方uni.css样式

对于css样式不熟练的我发现uni-app的demo中有很多类似uni-row的样式,不过需要先引入到自己的项目中。下面为具体步骤

官网地址 : https://github.com/dcloudio/hello-uniapp/tree/master/common

下载uni.css文件到自己的项目目录下,比如放到根目录common文件夹下

 

然后在根目录App.vue的style中添加

<style lang="scss">
    /*每个页面公共css */
    @import '@/common/uni.css';
</style>

接着运行会发现报错缺少文件:

 

 

寻找发现uni.css文件中用到了uni.tff文件

 

 

则官方路径找到该文件下载到项目中即可

文件目录

 

posted @ 2022-03-08 16:13  听着music睡  阅读(715)  评论(0编辑  收藏  举报