vue子组件实时获取父组件传来的值

通过在子组件内,使用watch 即可

props:{
        taskRelationFileList:{
            type: Array,
            default:() => {
                return []
            }
        }
    },

watch:{
        taskRelationFileList(val){ 
            this.taskRelationFileList_  = getArrSpecificValues(val, 'fileId');
        }
    },

猜你喜欢

转载自www.cnblogs.com/-roc/p/12143793.html
今日推荐