Adrian Klark
Adrian Klark

Reputation: 133

How can i make in vue devtools to show errors?

I have install Vue Devtootls but each time I have errors it doesn't show in the console I see o laracast they have like [vue: warn] and the error. I put this code but nothing.

catch(function(error){ console.log(error.message); });
   }

Upvotes: 3

Views: 3624

Answers (1)

choasia
choasia

Reputation: 10852

I think you have a misunderstanding on vue-devtools, vue-devtools is a browser extension used as a debugging tool. You can check your components, events and more information via it. Please have a look at its introduction on GitHub.

vue-devtools

On the other hand, messages like [vue: warn] ... are produced by Vue itself. The reason that you didn't get the messages is simply because you used vue.min.js instead of vue.js, I think. Save following code as a html file and then open it in chrome. You should be able to see the warning message in Chrome's console.

<!DOCTYPE html>
<html>
<head>
  <title>Vue test</title>
</head>
<body>
  <script type="text/javascript" src="https://unpkg.com/[email protected]/dist/vue.js"></script>
  <div id="app">
    <span>{{ message }}</span>
    <component1></component1>
  </div>
  <script>
    // Vue.component('component1', {
    //   template: '<button>{{ message }}</button>',
    //   data: function() {
    //     return {
    //       message: 'I am a test button'
    //     };
    //   }
    // });
    var vm = new Vue({
      el: '#app',
      data: {
        message: 'hello'
      },
    });
  </script>
</body>
</html>

vue-warn

Upvotes: 2

Related Questions