Event for entire view has been re-rendered

Posted . Visible to the public.
var vPlan = new Vue({
    el: '#v-plan',
    data: {
        plans: <?php echo $this->plansToJson() ?>,
        plan: <?php echo $this->planToJson() ?>,
        providerType: {code: '', items: <?php echo $this->providerTypeToJson() ?>},
        providerGroup: {code: '', items: <?php echo $this->providerGroupToJson() ?>},
    },
    updated: function () {
        this.$nextTick(function () { // Entire view has been re-rendered.
            if ($('member-plan')) decorateTable('member-plan');
        })
    },
    methods: {
        planOnChange: function(e) {
            this.plan = this.plans[e.target.selectedIndex];
        },
        showBenefit: function(item, section, code) {
            const show = item.utilize_method
                && (!this.providerType.code || !item.provider_type || item.provider_type.indexOf(this.providerType.code) > -1)
                && (!this.providerGroup.code || !item.provider_group || item.provider_group.indexOf(this.providerGroup.code) > -1);
            if (!show) --section.showCount;
            <?php // Initialize section for cumulation calc. ?>
            if (item.utilize_level == 'section') {
                section.ulCode = code;
                section.ulValues = {};
            }
            return show;
        },
        initSection: function(section) {
            section.showCount = section.benefit_count;
            return true;
        }
    }
});
kiatng
Posted by kiatng to Vue.js (2021-09-15 01:12)