简体   繁体   English

如何在VUE中使用jQuery

[英]How to use jQuery in VUE

I'm trying to recreate this sticky column html table https://codepen.io/paulobrien/pen/gWoVzN我正在尝试重新创建此粘性列 html 表https://codepen.io/paulobrien/pen/gWoVzN

I've run npm install --save jquery .我已经运行npm install --save jquery I've used it on mounted.我已经在安装时使用它了。 But it seems to not work.但这似乎不起作用。
Any idea how to implement jquery inside vue js?知道如何在 vue js 中实现 jquery 吗?

Import jquery in your vue component:在你的 vue 组件中导入 jquery:

import $ from 'jquery'

Run the command to install jQuery运行命令安装jQuery

npm install --save

Now you can use it in your component by importing it现在您可以通过导入它在您的组件中使用它

import $ from "jquery";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM