- Vue.js 2 Design Patterns and Best Practices
- Paul Halliday
- 140字
- 2021-06-24 18:33:01
Installing the Vue devtools
Head over to the Google Chrome Extensions store and download Vue.js devtools (https://goo.gl/Sc3YU1). After installing this, you'll then have access to the Vue panel within your developer tools. In the following example, we're able to see the data object inside of our Vue instance:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Vue.js</title>
</head>
<body>
<div id="app"></div>
<script src="http://unpkg.com/vue"></script>
<script>
Vue.config.devtools = true
new Vue({
el: '#app',
data: {
name: 'Vue.js Devtools',
browser: 'Google Chrome'
},
template: `
<div>
<h1> I'm using {{name}} with {{browser}}</h1>
</div>
`
});
</script>
</body>
</html>
If we then head over to our browser and open up the devtools we can see that Vue has been detected and that our message has outputted on to the screen:

We'll be using this throughout the book to gain extra insight into our applications. Do be aware that the developer tools will only recognize your Vue project if it is served on a local server.
推薦閱讀
- 智慧城市:大數據、互聯網時代的城市治理(第4版)
- Cisco OSPF命令與配置手冊
- 數據通信網絡實踐:基礎知識與交換機技術
- 物聯網(IoT)基礎:網絡技術+協議+用例
- 智能網聯汽車V2X與智能網聯設施I2X
- 網絡故障現場處理實踐(第4版)
- SD-WAN架構與技術(第2版)
- 物聯網時代
- 企業網絡安全管理
- 區塊鏈輕松上手:原理、源碼、搭建與應用
- Metasploit Penetration Testing Cookbook
- 智慧光網絡:關鍵技術、應用實踐和未來演進
- Learning Node.js Development
- 現代通信系統(第5版)
- Building RESTful Web Services with .NET Core