0
전역 (Vue) 객체 에 데이터를 할당합니다 (debbuger에서 확인) 이전 값으로 돌아갑니다 func를 종료합니다.함수에서 전역 Vue 객체에 할당 된 데이터는 함수를 종료 한 후 "삭제"됩니다
거기 머물러있게하려면 어떻게해야합니까? 당신이 당신의 뷰 응용 프로그램의 내부에 글로벌 데이터를 원하는 경우
"use strict";
var App =
{
debugMode: 2,//0=no, 1=yes, 2=special deep debug :-(~)
serverApi: '../../Server/CrmAPI.php',
navTemplate: new Vue({el: '#menuTemplate',
data: {
objectName: "",
brandName: "CRM"
}
}),
currentObject: null // each time containes a different object that currently active by user selection
}
function navigateMainNav(selectedObj)
{
var objectName = selectedObj; //try 1
window.App.navTemplate.objectName = objectName; //try 2
App.navTemplate.data.objectName = objectName; // try 3
window.location.href = "../html/templates/navTemplate.html" ; // load html
}