web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
444 B

  1. 'use strict';
  2. const Container = require('./container');
  3. const Node = require('./node');
  4. class NumberNode extends Node {
  5. constructor (opts) {
  6. super(opts);
  7. this.type = 'number';
  8. this.unit = Object(opts).unit || '';
  9. }
  10. toString () {
  11. return [
  12. this.raws.before,
  13. String(this.value),
  14. this.unit,
  15. this.raws.after
  16. ].join('');
  17. }
  18. };
  19. Container.registerWalker(NumberNode);
  20. module.exports = NumberNode;