Vue.js 尝试通过控制台设置变量时未定义应用程序
让我的脚在Vue中湿透: JS: 我得到:Vue.js 尝试通过控制台设置变量时未定义应用程序,vue.js,Vue.js,让我的脚在Vue中湿透: JS: 我得到: VM1674:1 Uncaught ReferenceError: app is not defined 您为DOMContentLoad事件定义了app内部函数,以便在其外部(也在控制台中)无法访问该函数。您需要在window对象中定义app变量才能全局访问它: const-app=新的Vue({ ///... }); window.app=app; <div id="findcoordinate"> <coordi
VM1674:1 Uncaught ReferenceError: app is not defined
您为
DOMContentLoad
事件定义了app
内部函数,以便在其外部(也在控制台中)无法访问该函数。您需要在window对象中定义app
变量才能全局访问它:
const-app=新的Vue({
///...
});
window.app=app;
<div id="findcoordinate">
<coordinate-form></coordinate-form>
</div>
app.coord = "Something";
VM1674:1 Uncaught ReferenceError: app is not defined