Skip to content

use Class with components #211

Closed Answered by sqllyw
sqllyw asked this question in Q&A
Discussion options

You must be logged in to vote

looks like only object methods are available to the pview, not the prototype methods, following code works:

constructor() {

            this.count = 2
            this.inc2 = () => {
              this.inc()
              console.log('inc2', this.count)
            }

        }

inc2 is an object method, inc is a prototype method, however changes to count is not reflected in the page,
demo3 partially working

Replies: 1 comment

Comment options

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