function GetRequest() { var url = location.search; //获取url中"?"符后的字串 var theRequest = new Object(); if (url.indexOf("?") != -1) { var str = url.substr(1); strs = str.split("&"); for(var i = 0; i < strs.length; i ++) { theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]); } } return theRequest; } new Vue({ el: '#app', data: { followUpTabs:[{ url: 'followup_register.html'+location.search, name: '随访登记' },{ url: 'followup_symptom.html'+location.search, name: '症状' },{ url: 'followup_sign.html'+location.search, name: '体征' },{ url: 'followup_inspect.html'+location.search, name: '实验室检查' },{ url: 'followup_guidance.html'+location.search, name: '生活方式指导' },{ url: 'followup_evaluate.html'+location.search, name: '评价' },{ url: 'followup_medication.html'+location.search, name: '用药情况' },{ url: 'followup_target.html'+location.search, name: '控制目标' },{ url: 'followup_education.html'+location.search, name: '健康教育' },{ url: 'followup_referral.html'+location.search, name: '转诊' }], activeidx: 0, clickOtherTab: true//其他是否可以点击 }, mounted: function() { var query = GetRequest(); this.activeidx = query.pro_id || 0; } }) $(function(){ $("#fv_tabs").on('click', 'a', function(){ var $this = $(this), $li = $this.parent(), index = $li.index(); if(parent.clickOtherTab){ $li.siblings().removeClass("active"); $li.addClass("active"); selectedTab = $this.data('index'); // reqLinkList.push(links[tab].url+'&from=tab&fromTabIdx='+fromTabIdx); var url = links[selectedTab].url; parent.document.getElementById('fv_main').src = url; }else{ return false; } }) }) parent.goFollowupNextQuestionaire = function(){ selectedTab ++; $("#fv_tabs a").eq(selectedTab).trigger('click'); }