Vue2: passing function as prop triggers warning that prop is already set

前端 未结 1 1680
谎友^
谎友^ 2021-01-21 12:45

I am new to Vue and I am so far enjoying the Single File Components.

Prior to making what I really want to make, I figured I would try some small things to see if I gras

相关标签:
1条回答
  • 2021-01-21 13:06

    Hope this helps.

    I would like to define a function onSuccess that I pass to the prop success, but this throws an error from Vue

    You are defining onSuccess outside of Vue. It should be defined in Vue's methods


    the computed properties for statusTooltip does not get updated

    In Javascript, an object is passed by reference. xhr always reference the same object. That's why the computed value won't update. See https://vuejs.org/v2/guide/reactivity.html#Change-Detection-Caveats . 1 way to solve it is to have another reactive data called xhrStatus and update this status manually in the xhr's event listeners.


    trying to set automaticCloseQ results in the default value no matter how I try to bind

    (I dunno what this means...)

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