[英]Correct way to integrate client side libraries (adminLTE) in vue js 2.0
I'm trying to integrate adminLTE with vue. 我正在尝试将adminLTE与vue集成。
I created aa new app with vue create admin-cli
我用
vue create admin-cli
创建了一个新应用
Then I did npm install admin-lte --save
as stated here: https://adminlte.io/docs/2.4/installation 然后我做了
npm install admin-lte --save
如下所示: https : //adminlte.io/docs/2.4/installation
Now npm downloads everything to node_modules/admin-lte 现在npm将所有内容下载到node_modules / admin-lte
I don't really know how to integrate adminLTE with the vue app. 我真的不知道如何将adminLTE与vue应用程序集成。 I guess I could just copy every file I need to the assets folder but I'd like to use some tool to spare me the job.
我想我可以将需要的每个文件复制到资产文件夹,但是我想使用一些工具来节省我的工作。
From a vue component (App.vue for example) I can do like this 从vue组件(例如App.vue),我可以这样
<img alt="Avatar" src="~admin-lte/dist/img/avatar.png">
The "~" will point to node_modules ( https://vue-loader.vuejs.org/guide/asset-url.html#transform-rules ) “〜”将指向node_modules( https://vue-loader.vuejs.org/guide/asset-url.html#transform-rules )
But I cant use it in public/index.html to include all the css and js dependencies of adminLTE. 但是我不能在public / index.html中使用它来包含adminLTE的所有css和js依赖项。
I think I have to configure webpack to copy all the needed dependencies, but I don't know how to achieve it. 我认为我必须配置webpack来复制所有需要的依赖项,但是我不知道如何实现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.