Closed lornally closed 5 years ago
That's the same problem. Getters and setters are not supported.
no ,it is not same problem, although i use this simple code:
const yy = stampit().compose({
props: {
i: 'iiiii',
},
methods: {
pp() {
this.i += 'p';
return this.i;
},
},
});
log('object pp:', yy.pp()); //here, get the bug: yy.pp is not a function
log('object pp:', yy.pp());
const zz = stampit().compose({
i: 'iiiii',
pp() {
this.i += 'p';
return this.i;
},
});
log('object pp:', zz.pp()); //here, get the bug: yy.pp is not a function
Oh. I see. Stampit has more API than the compose function. https://stampit.js.org/essentials/what-is-a-stamp
In your case the "props" is not recognised by compose function.
thanks, that my mistake, yy is a stamp, not a object, if i want a object, i need stamp it .:) here is the right code:
const yy = stampit().compose({
properties: {
i: 'iiiii',
},
methods: {
pp() {
this.i += 'p';
return this.i;
},
},
});
const yyy=yy();
log('object pp:', yyy.pp());
log('object pp:', yyy.pp());
at first, this is not right too: