wxs不支持es6写法吗
发布于 5 年前 作者 xiuying22 16136 次浏览 来自 问答

let foo = “‘hello world’ from comm.wxs”;

const bar = function (d) {

return d;

}

module.exports ={

foo:foo,bar:bar

}

然后报错

 1 | let foo = “‘hello world’ from comm.wxs”;

    |       ^

  2 | const bar = function (d) {

  3 |   return d;

  4 | }

真的不支持es6吗?

3 回复

我也很无奈啊,语法完全就是js;但是只是支持到es5; es6 的所有都不支持。。。。。希望能改进吧

wxs搞得和js基本一毛一样,但是又不能完全使用js的东西,那不是让我们抓狂吗

wxs和js明显是使用同样的语法规范,干嘛还声称是不同的语言?装吗?或者偏要搞出点不同?

回到顶部