原生js和vue.js实现数据共享

1.原生js生明全局变量

<script th:inline="javascript">
var aa="aa";
</script>

1.vue.js

<script th:inline="javascript">

var vm = new Vue({
el : "#app",
data : {
sendId : ‘‘,
versonNo : ‘‘,
update : ‘‘
},

mounted: function() {
debugger
this.sendId = response.getParameter("sendId");
this.versonNo = response.getParameter("versonNo");
this.update = response.getParameter("update");
var filePath = response.getParameter("filePath");
TANGER_OCX.BeginOpenFromURL($$pageContextPath+"/szgl/oaText/downloadText?filePath="+filePath);
aa="bb";
},
methods : {
save : function() {
TANGER_OCX.SaveToURL($$pageContextPath+"/szgl/oaText//uploadOaSendText?sendid=" + this.sendId + "&versonNo=" + this.versonNo, "upload");
$.alert(‘提示信息‘,"保存成功",function(){$.close(true);});
}


}
});
</script>

3.ntko.js调用全局变量

<script language="JScript" for="TANGER_OCX" event="OnDocumentOpened(TANGER_OCX_str,TANGER_OCX_obj)">
alert(aa)
var NTKO=document.getElementById("TANGER_OCX");
console.log(NTKO);
NTKO.SetReadOnly(true);
</script>