本教程为《用WordPress与uni-app开发,包含所有源代码》系列教程之一。
全功能WordPress API接口工具已出
全功能WordPress API接口工具已出只为前端开发者的你设计,详情查看:Sliver Rest Wp api:全功能的WordPress api工具
前言
本节开始,我将带领大家做一个文章阅读页面,在本小节中我将先创建一个本地静态化阅读页面。
开始
打开项目目录的pages文件夹,右键:

建完之后目录结构如下:

之后<template>标签区域编写代码如下:
<template>
<view>
<view class="readPage">
<view class="title">文章标题</view>
<view class="info">
<text class="name">作者</text>
<text class="dot"></text>
<text class="date">时间</text>
</view>
<view class="text">文章内容</view>
</view>
</view>
</template>
效果如下:

CSS美化代码:
<style>
.readPage{
padding: 30rpx;
background-color: #FFFFFF;
}
.readPage .title{
letter-spacing: 4rpx;
border-bottom: 4rpx solid #795647;
padding-bottom: 10rpx;
font-weight: bold;
line-height: 2;
}
.readPage .info{
margin-top: 30rpx;
font-size: 12rpx;
display: flex;
align-items: center;
}
.readPage .info .dot{
display: inline-block;
width: 10rpx;
height: 10rpx;
background-color: #795647;
border-radius: 10rpx;
margin: 0 30rpx;
}
.readPage .text{
padding-top: 30rpx;
margin-top: 30rpx;
font-size: 28rpx;
border-top: 4rpx solid #795647;
}
</style>
效果

代码仓库: https://github.com/sliverRing/uniApp-WPApp
QQ交流群: 824144151
技术援助
需要技术援助?点击这里,帮你解决你的所有问题!PS:可能你离大神之间,只差一个我们!!!!