Skip to content

using getter in x-bind #3492

Answered by capymind
capymind asked this question in 1. Help
Discussion options

You must be logged in to vote

Sorry.... This is 100% my fault. The code above work correctly...

Original wrong code snippet is below..

   <div :class="is_valid_sum_of_items === 100 ? 'text-valid-green' : 'text-invalid-red'">
        This block has a problem. `is_valid_sum_of_items` getter does not invoked I guess `undefined`. So
    </div>

is_valid_sum_of_items getter already return true or false based on property sum_of_items in x-data. so is_valid_sum_of_items === 100 is true === 100 or false === 100. :(

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by capymind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant