Typescript with Polymer 1.0?

前端 未结 2 1296
予麋鹿
予麋鹿 2021-02-07 22:48

I found this great article I had been using with Polymer 0.5 ( http://www.mikecann.co.uk/programming/tinkering-with-google-polymer-and-typescript/ ) for being able to use Typesc

相关标签:
2条回答
  • 2021-02-07 23:15

    You can try this:

    class CreatorStudio extends Polymer.Class(
        {
            is: "creator-studio",
            properties: {}
        }
    ){
        ready() {
            // ...
        }
        created(){
            // ...
        }
    

    and later:

    document.registerElement(CreatorStudio.prototype.is, CreatorStudio);
    

    Here's a working sample (although using Babel, not Typescript): http://codepen.io/mikkokam/pen/jPMLJN

    0 讨论(0)
  • 2021-02-07 23:22

    you can use the package PolymerTS

    0 讨论(0)
提交回复
热议问题