mamahaha
V2EX  ›  问与答

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

  •  
  •   mamahaha · Mar 3, 2019 · 1745 views
    This topic created in 2820 days ago, the information mentioned may be changed or developed.

    遇到了下边这样的情形

    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 replies  •  2019-03-03 16:17:39 +08:00
    mamahaha
    mamahaha
    OP
    Mar 3, 2019
    1
    啊,解决了,把 this 赋值给随便一个 taht
    然后 taht.imgsrc=value,就能穿出来了
    zollum
    zollum
    Mar 3, 2019
    2
    data 里面只能是函数,比如 data() {return {imgsrc: ''}}
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1848 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 11:54 · PVG 19:54 · LAX 03:54 · JFK 06:54
    ♥ Do have faith in what you're doing.