Giter VIP home page Giter VIP logo

Comments (4)

koresar avatar koresar commented on July 17, 2024

That's the same problem. Getters and setters are not supported.

from stamp-specification.

lornally avatar lornally commented on July 17, 2024

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

from stamp-specification.

koresar avatar koresar commented on July 17, 2024

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.

from stamp-specification.

lornally avatar lornally commented on July 17, 2024

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());

from stamp-specification.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.