Vue.js random image not showing

前端 未结 1 737
隐瞒了意图╮
隐瞒了意图╮ 2021-01-25 18:19

Anyone have an idea to why this isn\'t working for me? I\'m running a vue-cli build. I don\'t get any errors, but the image isn\'t showing. I\'m new to vue.js so the solution is

1条回答
  •  無奈伤痛
    2021-01-25 18:37

    Here data should be a function that returns an object.

    
    
    
    

    Here's an explanation why data must be function: https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function

    Basically, it is dictated by design that data must be a function that returns an object, to avoid cross referencing JavaScript objects.

    0 讨论(0)
提交回复
热议问题