Giter VIP home page Giter VIP logo

Comments (3)

jinzhubaofu avatar jinzhubaofu commented on July 17, 2024

现在 san 是通过支持类的静态成员来支持的:

class MyComponent extends san.Component {
  static template = `
    <div>xxxx</div>
  `;
}

当然,需要你自己给 babel 加上插件或者相应的 preset。

from san.

ayqy avatar ayqy commented on July 17, 2024

san是这样做了没错,只是文档描述ESNext可能不很妥当

from san.

errorrik avatar errorrik commented on July 17, 2024

我们并不建议使用 get 来搞。至于描述,我没看出不妥当在哪。static 虽然没有任何运行环境支持,但也属于 ESNext 的一部分。 https://github.com/tc39/proposal-class-fields

如果 @ayqy 觉得不恰当的话,可以在 san-website 的 repo 提 pull-request 咯,这个 issue 我就关了

from san.

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.