Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这样做:
import $ from 'jquery';
显示错误
The $ prefix is reserved, and cannot be used for variable and import names svelte(illegal-declaration)
您可以只使用import as语法:
import as
import * as $j from 'jquery';
或者anyName 你可以使用
anyName
我注意到,如果 JQuery 已经在全球范围内可用,那么您可以通过window.$而不是 just访问它,$并且 svelte 编译器不会抱怨。
window.$
$