babel compiled decorator

@babel7.x

--save-dev @ install npm babel / plugin-Proposal-Decorators
package.json in the babel configuration, adding:

{
      "plugins": [
            ["@babel/plugin-proposal-decorators", { "legacy": true }],
            ["@babel/plugin-proposal-class-properties", { "loose" : true }]
      ]
}

Can only be used as follows: export @decorator class Bar {}
not: @decorator
Export class Foo {}
solution is still in search

Guess you like

Origin www.cnblogs.com/tdd-qdkfgcs/p/11275634.html