moqui / moqui-runtime

The default runtime directory for Moqui Framework
Other
37 stars 79 forks source link

Use $set to make m-form.fieldsChanged reactive. #200

Closed chunlinyao closed 2 years ago

chunlinyao commented 2 years ago

Can watch change in child components.


    computed: {
        result: function() {
            return this.$parent.fieldsChanged;
        }
    },
    watch: {
        '$parent.fieldsChanged': function(newValue, oldValue) {
            console.log('fieldsChanged changed from ' + JSON.stringify(oldValue) + ' to ' + JSON.stringify(newValue));
        }
    }
jonesde commented 2 years ago

Looks good to me, thank you Chunlin