【问题标题】:Web animations ionic 2 iOS网络动画 ionic 2 iOS
【发布时间】:2017-03-08 20:31:08
【问题描述】:

如何让 web 动画在 ionic 2 for iOS 中运行?我看过关于 web 动画 polyfill 的讨论,但是还没有找到一个易于遵循的实现指南。任何帮助,将不胜感激。谢谢!

【问题讨论】:

    标签: ios angular animation ionic2 ionic3


    【解决方案1】:

    就像你在Angular2 docs看到的一样

    Angular 动画构建在标准 Web 动画 API 之上 并在支持它的浏览器上本地运行。 对于其他浏览器,需要 polyfill。抓取 web-animations.min.js 从 GitHub 并将其添加到您的页面。

    所以复制web-animations js code 并将其粘贴到一个新文件中,例如assets/js(新文件夹)。

    然后将其添加到index.html 文件中,作为正文的第一个脚本标记:

    <body>
    
      <!-- Ionic's root component and where the app will load -->
      <ion-app></ion-app>
    
      <!-- Web Animations polyfill -->
      <script src="assets/js/web-animations.js"></script>
    
      <!-- The polyfills js is generated during the build process -->
      <script src="build/polyfills.js"></script>
    
      <!-- The bundle js is generated during the build process -->
      <script src="build/main.js"></script>
    
    </body>
    

    【讨论】:

      猜你喜欢
      • 2017-07-12
      • 2017-04-17
      • 2019-01-19
      • 1970-01-01
      • 2016-04-03
      • 1970-01-01
      • 2017-10-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多