小程序解决背景图拉伸问题
2019-08-15 本文已影响0人
ONE2
![](https://img.haomeiwen.com/i1206289/395731e7970d19d3.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()
-- END --
欢迎体验作者开发的小程序
![](https://img.haomeiwen.com/i1206289/fecbdb64a5037537.jpg)