• 原生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>

  • 相关阅读:
    书签快捷键0
    msxml3.dll 执行页内操作时的错误
    DrawGrid DrawFocusRect
    RAD XE8
    Richview 首页 奇偶页 不同页眉页脚
    改变画布大小
    c# 数据集调试工具插件
    数据库连接补丁 驱动
    怎么关闭百度推广
    被封的著名网站
  • 原文地址:https://www.cnblogs.com/zhangzhiqin/p/12306286.html
Copyright © 2020-2023  润新知