官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 大石桥市| 汨罗市| 南通市| 改则县| 陇西县| 瑞丽市| 绵竹市| 淮滨县| 聊城市| 锦州市| 麦盖提县| 宝丰县| 齐齐哈尔市| 英德市| 宿迁市| 班戈县| 舞阳县| 嘉义县| 井研县| 潜山县| 澜沧| 广安市| 泾源县| 绍兴县| 陇南市| 本溪市| 瓦房店市| 垫江县| 北宁市| 苏尼特左旗| 平阳县| 长乐市| 宁远县| 日喀则市| 布尔津县| 乌拉特中旗| 会同县| 蓬安县| 云安县| 洛阳市| 济阳县|