0
將數據分配到全局(Vue)對象 它正在進入(在debbuger上檢查它) 但返回到它的prev值當退出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
}