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

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.

主站蜘蛛池模板: 邮箱| 昌乐县| 白玉县| 贵德县| 增城市| 天峨县| 抚州市| 大竹县| 海林市| 绥德县| 卓资县| 涞源县| 调兵山市| 博爱县| 西藏| 沧州市| 龙泉市| 墨玉县| 苍南县| 南溪县| 阿勒泰市| 隆德县| 图片| 左权县| 共和县| 潞西市| 邹城市| 防城港市| 上蔡县| 东阿县| 冀州市| 九寨沟县| 巴里| 九龙坡区| 武宣县| 三河市| 陇川县| 长春市| 吴川市| 广西| 奉化市|