Skip to content

class get cache issue #424

@John0King

Description

@John0King

copied from kaorun343/vue-property-decorator#320.

I do not know which repo should handle this issue, but

the get/set should not be cached to align with the class's behavior

@Component
export default class MyComponent extends Vue{
    @Prop({type:Object, default:()=({})})
     value!:any;

    obj:any = {};
    get obj2(){
        console.log("get ")// this will only log once,
        return {...obj, a: new Date()}
    }

    @Watch('value',{ deep:true})
    watchValue(v:any){
        this.obj = {... this.value}
    }

    mounted(){
         this.watchValue(this.value);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions