小程序站点信息可使用的标签
1、导入API文件路径
const api = require('../../utils/api.js'); //路径根据自己的实际情况调整
2、在 index.js 生命周期函数--监听页面加载中编写赋值代码
// 站点信息
api.siteInfos().then(function (site) {
that.setData({
site: site.data,
})
})
直接在view
标签或者text
等标签内使用即可
<view> {{ siteInfos.index }} </view>
{{ site.title }} | 站点标题 |
{{ site.subtitle }} | 站点副标题 |
{{ site.domain }} | 站点域名 |
{{ site.logo }} | 站点logo |
{{ site.keywords }} | 站点关键字 |
{{ site.description }} | 站点描述 |
{{ site.icp }} | 站点备案信息 |
{{ site.statistical }} | 站点统计 |
{{ site.copyright }} | 站点版权 |