首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Vue devtools不会在Laravel应用程序中显示

Vue devtools不会在Laravel应用程序中显示
EN

Stack Overflow用户
提问于 2018-03-29 22:56:52
回答 1查看 1.9K关注 0票数 0

在我的新的Laravel应用程序中,我很难启用Vue dev工具。

我看到了this question,但我不想重设我的项目,我相信这是命令做的。

我也不能删除生产提示

当我在控制台中window.Vue.config时,我得到以下内容:

代码语言:javascript
复制
{
   ...
   devtools: true
   productionTip: false
}

我的reasources/assets/js/index.js读到:

代码语言:javascript
复制
/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */

require('./bootstrap');

window.Vue = require('vue');

window.Vue.config.productionTip = false
window.Vue.config.devtools = true

/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */

import App from './App.vue'

const app = new Vue({
  el: '#app',
  components: { App },
  template: '<App />'
});

尽管如此,这些更改并没有反映在实际的dev工具UI中。

EN

回答 1

Stack Overflow用户

发布于 2022-05-11 13:27:55

而不是在导入的Vue上,在结果的app对象上设置这些变量。这在Vue 2和3中都适用,如下所示:

代码语言:javascript
复制
const app = new Vue({…});  // vue 2
const app = createApp({…});  // vue 3

window.app = app;
window.app.config.productionTip = false;
window.app.config.devtools = true;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49566204

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档