let obj = {
      obj1 :{
          say:'hi1'
      },
      obj2 :{
          say:'hi2'
      }
  }
  
 let one = "obj1"
 let two = "say"
 
 // 等于 obj.obj1.say
 // `` 是ESC下 TAB上的哪个键
 console.log(
     obj[`${one}`][`${two}`]
 )
 // 输出 > hi1

 

this.setData({
   [`obj.a.b.c`] : 'value' 
})

 

相关文章:

  • 2022-02-10
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2021-12-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-15
相关资源
相似解决方案