V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
mamahaha
V2EX  ›  问与答

请教大家, blob 地址是字符串吗?

  •  
  •   mamahaha · 2019-03-03 15:50:01 +08:00 · 1023 次点击
    这是一个创建于 1895 天前的主题,其中的信息可能已经有所发展或是发生改变。

    遇到了下边这样的情形

    vue 里定义 data:{imgsrc:''}

    在控制台显示 value ( blob 地址) console.log(value)

    把 value 传递给 imgsrc this.imgsrc=value

    控制台内容 blob:http://test02.test/3b12f6e2-e214-4021-a5b1-axxxxxxxx TypeError: Cannot set property 'imgsrc' of undefined

    请教一下,如何把 value 传递给 imgsrc 呢?

    2 条回复    2019-03-03 16:17:39 +08:00
    mamahaha
        1
    mamahaha  
    OP
       2019-03-03 16:05:57 +08:00
    啊,解决了,把 this 赋值给随便一个 taht
    然后 taht.imgsrc=value,就能穿出来了
    iamaprin
        2
    iamaprin  
       2019-03-03 16:17:39 +08:00
    data 里面只能是函数,比如 data() {return {imgsrc: ''}}
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3513 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 10:57 · PVG 18:57 · LAX 03:57 · JFK 06:57
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.