I have a base class like defined below
import Vue from "vue";
class ComponentBase extends Vue {
constructor() {
super();
this.left = 100;
this.top = 100;
this.isSelected = false;
}
public left: number;
public top: number;
public isSelected: boolean;
public select = () => {
this.isSelected = true;
}
}
And I use a derived class like below
<template>
<div class="selectable" @click="select" v-bind:class="{ selected : isSelected }" v-bind:style="{ left: left + 'mm', top: top + 'mm' }">
<div class="componentBody">
Product Content
</div>
</div>
</template>
import { ComponentBase } from "./TextControls"
import { Component, Prop } from 'vue-property-decorator';
@Component
export default class Product extends ComponentBase {
constructor() {
super();
this.left = 0;
this.top = 0;
}
}
I have a reference to call select method from base class in derived class's html template as click event. When I click to something it is firing the select method in base class and changes the isSelected property. However I can't see the effect in html.
I have checked whether binding working vie Vue Dev Tools and it is working like a charm. I can not understand why my manually called method cannot update my UI.
constructorbecause you can already do it viapublic left: number = 100;and so on