1、直接对串进行拼接 如 app.globalData.server_url=“https://image.baidu.com/",action='search' let url0 = `${app.globalData.server_url}${action}`; 则 url0=‘https://image.baidu.com/search' 2、实现SetData对变量名赋值 如:let para1=’name‘,value1='马大哈' this.setData({ [`${para1}`]: value1 }) 则实现了对name的赋值,等同于: this.setData({ name:'马大哈' })
标签:马大哈,name,微信,拼接,SetData,变量名,赋值 From: https://www.cnblogs.com/youxl189/p/17065985.html