小程序解决背景图拉伸问题

image.png

设计将背景切成了三段,左边、中间、右边
重新设置width解决问题
const query = wx.createSelectorQuery().in(that)
query.select('.nick-center-content').boundingClientRect(function (res) {
console.log(res)
that.setData({
nickWidth: parseInt(res.width)
})
// res.width
}).exec()

你可能感兴趣的:(小程序解决背景图拉伸问题)