search

Home  >  Q&A  >  body text

javascript - vue single file scope problem

As shown above, how to use SvgInjector in mounted?
React The party expressed some doubts. . .

滿天的星座滿天的星座2803 days ago890

reply all(3)I'll reply

  • ringa_lee

    ringa_lee2017-06-26 10:53:54

    You spelled it wrong, pay attention to capitalization

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-06-26 10:53:54

    Put it directly into the static folder in the vue root directory,

    Add

    to

    index
    <script src="/static/xxx.min.js"></script>
    //注意是绝对路径
    

    Then follow the official documentation

    Just use it directly

    Here is why it is best to use it this way,

    Because if you import too many third-party libraries, they will be packaged into the final js loaded for the first time.

    will make him big,

    The first loading will be slow

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-06-26 10:53:54

    You introduced SvgInjector

    Then you use SVGInjector when mounted...

    You definitely won’t need it. .

    reply
    0
  • Cancelreply