Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在wxml中调用js的方法不需要加"{{}}"吧 #1

Open
sjtupt opened this issue Dec 15, 2016 · 3 comments
Open

在wxml中调用js的方法不需要加"{{}}"吧 #1

sjtupt opened this issue Dec 15, 2016 · 3 comments

Comments

@sjtupt
Copy link

sjtupt commented Dec 15, 2016

在index.wxml的第21行,需要去掉{{}}才能正常运行

@swm888
Copy link

swm888 commented May 19, 2017

多谢你的提醒让项目正常运行了, 但可以解释一下为什么要取消这个中括号吗,谢谢你.

@ldc4
Copy link

ldc4 commented Jun 10, 2017

WXML根本就不能用函数好吧,而且README.md中的动图上面显示的是bad exp
估计开发者工具升级后,直接报错了

可以在生命周期中进行数据处理:

  // lifecycle
  onLoad() {
    console.log('timeline onLoad');
    console.log(this.data);

    var _data = this.data.timeLine;

    if(_data && _data.length > 0){
      _data.map(function(item){
        item.content = item.content.substr(0,20);
      });
    }

    this.setData({
      timeLine: _data
    });

  },

@swm888
Copy link

swm888 commented Jun 12, 2017

嗯嗯, 了解了。 谢谢您的解答。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants