How to Include JQuery in a Svelte/Sapper Application?

寵の児 提交于 2019-12-11 03:06:22

问题


There are many components that still require JQuery that I need to use (unfortunately).

What is the best way to do this in Svelte/Sapper? Should I use ES6 Imports, modify rollup, or what is the best approach?

For example, I need to include a pivot table, grid, scheduler, etc from DevExpress or Kendo UI.

I can pull in JQuery globally in the template.html file and get things to work, but I'm sure this is not the best way.


回答1:


Including it as a <script> in template.html is fine. Alternatively, do

import jQuery from 'jquery';

in any components or modules that use it.



来源:https://stackoverflow.com/questions/57792330/how-to-include-jquery-in-a-svelte-sapper-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!