Blame view

天文台pc/tianwentai-ui/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs 546 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  import { MotionValue, transformProps, acceleratedValues } from 'motion-dom';
  
  class WillChangeMotionValue extends MotionValue {
      constructor() {
          super(...arguments);
          this.isEnabled = false;
      }
      add(name) {
          if (transformProps.has(name) || acceleratedValues.has(name)) {
              this.isEnabled = true;
              this.update();
          }
      }
      update() {
          this.set(this.isEnabled ? "transform" : "auto");
      }
  }
  
  export { WillChangeMotionValue };
  //# sourceMappingURL=WillChangeMotionValue.mjs.map