一、下载

链接:https://pan.baidu.com/s/1D6vNSSBZI22_K1BzLEXpbg
提取码:of6g 

修改binding.js中的window.bind=binding为如下:

小程序 之eval替代方案(Binding.js)

二、示例

const app = getApp();
require("../../lib/binding.js");
Page({
  data: {

  },
  onLoad: function (options) {
    console.log(wx.binding.eval("(1 + 2) * 4 / 2")); //console 6
  },
  onShow: function () {

  },
})

三、参考算法

https://blog.csdn.net/jiexiaopei_2004/article/details/41546673

 

相关文章:

  • 2022-01-20
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2021-06-27
  • 2021-09-29
猜你喜欢
  • 2022-12-23
  • 2022-02-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2021-08-14
相关资源
相似解决方案