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

原生setData中有个渲染完成的callback回调 #712

Closed
WarriorLau opened this issue Jan 2, 2018 · 6 comments
Closed

原生setData中有个渲染完成的callback回调 #712

WarriorLau opened this issue Jan 2, 2018 · 6 comments

Comments

@WarriorLau
Copy link

Wepy中绑定数据的方式或者修改后的setData方法都没有这个回调函数的入口(1.5.0新增),能否添加或像vue中的nextTick一样使用的方法

Gcaufy added a commit that referenced this issue Jan 2, 2018
@Gcaufy
Copy link
Collaborator

Gcaufy commented Jan 2, 2018

使用方法:

this.num++;
this.$nextTick(function () {
   // console.log('setdata callback');
});

或者

this.num++;
this.$nextTick().then(() => console.log('setdata callback'));

Gcaufy added a commit that referenced this issue Jan 2, 2018
@BoleLee
Copy link

BoleLee commented Jan 26, 2018

你好,我看文档说使用$nextTick需要wepy版本为v1.6.1,通过npm install --save wepy@1.6.1 获取不到这个版本号的包,文档的更新日志也没有1.6.1版本的信息,请问如何获取1.6.1版本? @Gcaufy

@richie523
Copy link

npm install wepy-cli@1.6.1-alpha7 -g

@BoleLee
Copy link

BoleLee commented Jan 31, 2018

安装了wepy-cli@1.6.1-alpha7 后,$nextTick 可以编译成功,但页面会报错:

thirdScriptError
this.$nextTick is not a function;

请问除了升级wepy-cli为1.6.1-alpha7, 是否还需要什么,才可以使用$nextTick ?
附:

wepy-cli: 1.6.1-alpha7
wepy: 1.6.0

另外,升级wepy-cli@1.6.1-alpha7后,使用wepy new project无法创建项目
@richie523 @Gcaufy

@richie523
Copy link

推荐你检查下node_modules里面的wepy的版本号

@Gcaufy
Copy link
Collaborator

Gcaufy commented Jan 31, 2018

@BoleLee

npm install wepy@1.6.1-alpha3 --save

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

4 participants