// pages/detail/detail.js // 29014 const $api = require('../../utils/api.js').API; Page({ /** * 页面的初始数据 */ data: { name:'', articleid:'', }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { $api.getArticle({id:options.id}).then(res=>{ let data = res.data.data data.content = data.content.replaceAll(' { // setTimeout(() => { // resolve({ // title: this.data.name // }) // }, 2000) // }), return{ title:this.data.name, path:'/pages/detail/detail?id=' + this.data.articleid } }, // onShareTimeline: function() { // return { // title: this.data.name, // query: {'id':this.data.articleid} // } // } })