为什么Vue.js Chrome Devtools无法检测到Vue.js? [英] Why is Vue.js Chrome Devtools not detecting Vue.js?
问题描述
我有以下代码和一个简单的Vue.js应用程序。但是vue.js devtools没有响应。几天前它运行良好,现在不再运行,可能是哪里出了问题?当我转到 https://chrome.google.com/webstore/detail/vuejs -devtools / nhdogjmejiglipccpnnnanhbledajbpd ,说它已经添加了。
I have the following code with a simple working Vue.js application. But the vue.js devtools is not responding. It was working well a few days ago, now it's not working anymore what could possibly be going wrong? when I go to https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd, it says it is already added.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="https://unpkg.com/vue@2.1.6/dist/vue.js"></script>
<title>Document</title>
</head>
<body>
<div class="container">
<div id="application">
<input type="text" v-model="message">
<p>The value of the input is: {{ message }}</p>
</div>
</div>
<script>
let data = {
message: 'Hello World'
}
new Vue({
el: '#application',
data: data
})
</script>
</body>
</html>
推荐答案
另一种方法是设置本地Web服务器,如OP 所述。
另一个-IMHO速度更快且骚扰更少-正在出租扩展名可以访问文件URL,该URL默认情况下处于禁用状态。
One alternative is to set up a local web server, as the OP already stated.
The other - which IMHO is faster and less harassing - is letting the extension have access to file URLs, which is disabled by default.
只需转到 chrome:// extensions
并选中Vue.js devtools的 允许访问文件URL 框。
Simply go to chrome://extensions
and leave the "Allow access to file URLs" box checked for Vue.js devtools.
来源:
< a href = https://github.com/vuejs/vue-devtools#common-problems-and-how-to-fix rel = noreferrer> https://github.com/vuejs/vue-devtools#常见问题和解决方法
http://codersdeck.com/vue-js-2-setting-vue-devtools/
这篇关于为什么Vue.js Chrome Devtools无法检测到Vue.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!