Skip to content

Tag: es6-class

javascript remove “onclick” event listener

I have tried many things, but none of them work. I wonder if it’s impossible? I know the ‘normal’ way with ‘bind’, but the arrow functions are much more readable and I prefer to use them. To better understand my question I made this sample code that illustrates the problem as ful…

Vuejs Es6 class reactivity

i’m trying to have a computed property in vuejs associated to a es6 class. My Vue instance looks like this: My class looks like this If i try to do something like that: but the setter is never called, like the reactivity has been lost and i don’t understand why. I also try: I pass customClass as a…

Serializing an ES6 class object as JSON

I’d like to serialize myClass object to json. One easy way I can think of is, since every member is actually javascript object (array, etc..) I guess I can maintain a variable to hold the member variables. this.prop.foo = this.foo and so on. I expected to find a toJSON/fromJSON library for class objects…