How to listen for 'props' changes

前端 未结 13 1566
无人及你
无人及你 2020-11-30 17:27

In the VueJs 2.0 docs I can\'t find any hooks that would listen on props changes.

Does VueJs have such hooks like onPropsUpdated() or simi

13条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 18:23

    I work with a computed property like:

        items:{
            get(){
                return this.resources;
            },
            set(v){
                this.$emit("update:resources", v)
            }
        },
    

    Resources is in this case a property:

    props: [ 'resources' ]
    

提交回复
热议问题