Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js 帆+;使用外部库的Vue_Vue.js_Sails.js - Fatal编程技术网

Vue.js 帆+;使用外部库的Vue

Vue.js 帆+;使用外部库的Vue,vue.js,sails.js,Vue.js,Sails.js,我已经从这个git存储库下载了Sails+VueJs框架示例代码 但发现我无法在Vue前端框架中使用Axios、Vutify等外部库。请帮我解决这个问题。您应该可以将它们放在资产/依赖项文件夹中。下次Grunt进行构建时,它将在layout.ejs文件中包含脚本。不要直接从layout.ejs文件中引用它,因为每次Grunt检测到更改时都会覆盖它 就实例化任何脚本而言,您可能希望在每个页面上都实例化Javascript文件assets/js/pages/{name of page}。在befor

我已经从这个git存储库下载了Sails+VueJs框架示例代码


但发现我无法在Vue前端框架中使用Axios、Vutify等外部库。请帮我解决这个问题。

您应该可以将它们放在
资产/依赖项文件夹中。下次Grunt进行构建时,它将在layout.ejs文件中包含脚本。不要直接从layout.ejs文件中引用它,因为每次Grunt检测到更改时都会覆盖它

就实例化任何脚本而言,您可能希望在每个页面上都实例化Javascript文件
assets/js/pages/{name of page}
。在beforeMount或mounted生命周期方法中。该方法也是您添加页面数据的方法:

beforeMount: function() {
//Instantiate script here
}