找回密码
 立即注册
搜索

开发问题 text不能动态显示值

2
回复
1382
查看
[复制链接]

5

主题

11

帖子

80

积分

 楼主| 2018-10-22 18:30:52 显示全部楼层 |阅读模式
我在template中就加入了text标签,写法 class="clstjnameone">{{tjnameone}}

11

主题

87

帖子

795

积分

2018-10-22 20:11:49 显示全部楼层
你的this指向有问题,在file.get的回调里的this指向是当前函数作用域。这样用才对
  1. onInit(){
  2. const that = this;
  3. file.get({
  4. uri: 'internal://files/path/to/file',
  5. success: function (data) {
  6. },
  7. fail: function (data, code) {
  8. that.test = 'asdf';
  9. }
  10. })
  11. }
复制代码
回复

使用道具 举报

5

主题

11

帖子

80

积分

 楼主| 2018-10-24 15:49:40 显示全部楼层
dadong 发表于 2018-10-22 20:11 你的this指向有问题,在file.get的回调里的this指向是当前函数作用域。这样用才对 ...
感谢,我先试一下
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册