vue对于ntko的应用经验

vue对于ntko的应用经验本来生活过的美滋滋 突然告知要用 ntko 写一个操作 word 文档的界面 看到后立马提起兴致看了下 ntko 的基本文档 安装 ntko 研究小 demo 研究完后心里立刻妈卖批了 这个 ntko 居然限制游览器与 word 版本 可把我研究苦了 chrome45 后就限制了插件入口 firfox 跟 chrome 差不多 所以只能用一些特定的进行开发 1 开发环境选择使用的是 IE11 word2016 游览器与

本来生活过的美滋滋,突然告知要用ntko写一个操作word文档的界面,看到后立马提起兴致看了下ntko的基本文档,安装ntko,研究小demo。研究完后心里立刻妈卖批了,这个ntko居然限制游览器与word版本,可把我研究苦了。chrome45后就限制了插件入口,firfox跟chrome差不多,所以只能用一些特定的进行开发。

1.开发环境

2.单页面的ntko嵌入到vue项目中去

if (browser=="IE"){ 
    if(window.navigator.platform=="Win32"){ 
    document.write(' 
    '); document.write(' 
    '); document.write('+classid+'"'); document.write('codebase="'+codebase+'" width="'+width+'" height="'+height+'"> '); document.write('+MakerCaption+'"> '); document.write('+MakerKey+'"> '); document.write('+ProductCaption+'"> '); document.write('+ProductKey+'"> '); document.write('+NoExpireKey+'"> '); document.write(' '); document.write(' '); document.write(' '); document.write('  不能装载文档控件。请在检查浏览器的选项中检查浏览器的安全设置。  '); document.write(''); } if(window.navigator.platform=="Win64"){ 
    document.write(' 
    '); document.write(' 
    '); document.write('+classidx64+'"'); document.write('codebase="'+codebase64+'" width="'+width+'" height="'+height+'"> '); document.write('+MakerCaption+'"> '); document.write('+MakerKey+'"> '); document.write('+ProductCaption+'"> '); document.write('+ProductKey+'"> '); document.write('+NoExpireKey+'"> '); document.write(' '); document.write(' '); document.write(' '); document.write('  不能装载文档控件。请在检查浏览器的选项中检查浏览器的安全设置。  '); document.write(''); } } else if (browser=="firefox"){ 
    document.write('+codebase+'" width="'+width+'" height="'+height+'" ForOnSaveToURL="ntkosavetourl" ForOndocumentopened="ntkoondocumentopened"'); document.write('ForOnpublishAshtmltourl="ntkopublishashtml"'); document.write('ForOnpublishAspdftourl="ntkopublishaspdf"'); document.write('ForOnSaveAsOtherFormatToUrl="ntkosaveasotherurl"'); document.write('_MakerCaption="'+MakerCaption+'" '); document.write('_MakerKey="'+MakerKey+'" '); document.write('_ProductCaption="'+ProductCaption+'" '); document.write('_ProductKey="'+ProductKey+'" '); document.write('_NoExpireKey="'+NoExpireKey+'" '); document.write('clsid="{'+classid+'}" >'); document.write('  尚未安装NTKO Web FireFox跨浏览器插件  '); document.write(' '); }else if(browser=="chrome"){ 
    document.write('+classid+'}" ForOnSaveToURL="ntkosavetourl" ForOndocumentopened="ntkoondocumentopened"'); document.write('ForOnpublishAshtmltourl="ntkopublishashtml"'); document.write('ForOnpublishAspdftourl="ntkopublishaspdf"'); document.write('ForOnSaveAsOtherFormatToUrl="ntkosaveasotherurl"'); document.write('_IsUseUTF8URL="-1" '); document.write('_IsUseUTF8Data="-1" '); document.write('_MakerCaption="'+MakerCaption+'" '); document.write('_MakerKey="'+MakerKey+'" '); document.write('_ProductCaption="'+ProductCaption+'" '); document.write('_NoExpireKey="'+NoExpireKey+'" '); document.write('_ProductKey="'+ProductKey+'" '); document.write('codebase="'+codebase+'" width="'+width+'" height="'+height+'" type="application/ntko-plug" '); document.write('  尚未安装NTKO Web Chrome跨浏览器插件  '); document.write(''); }else if (Sys.opera){ 
    alert("sorry,ntko web印章暂时不支持opera!"); }else if (Sys.safari){ 
    alert("sorry,ntko web印章暂时不支持safari!"); } 
str = ' 
    ' + ' 
    '+ '+classid+'"')+ 'codebase="'+codebase+'" width="'+width+'" height="'+height+'"> ' + '+MakerCaption+'"> '+ '+MakerKey+'"> ' + '+ProductCaption+'"> ' + '+ProductKey+'"> ' + '+NoExpireKey+'"> ' + ' ' + ' ' + ' '+ '  不能装载文档控件。请在检查浏览器的选项中检查浏览器的安全设置。  ' + ''); document.getElementById('container').innerHTML = str; 
<script event="OnDocActivated(isActivated)" for="TANGER_OCX"> document.getElementById('aaaaa').onD(isActivated); </script> 

在Vue项目中进行定义onD属性

export default({ 
    mounted(){ 
    document.getElementById('aaaaa').onD = function(){ 
    } } }) 

这样算是完成了事件的传递工作,还有一个坑就是OnDocActivated不执行完毕好像没有ActiveWindow这个属性,所以当时利用了一个定时器延迟执行。

总结

这个ntko的项目写的人挺绝望的,IE游览器用的让人绝望,ntko每次加载还会出现页面卡顿的情况,开发时间大多数是用在等待IE游览器运行,挺考验人的耐心的。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/204060.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月19日 下午9:06
下一篇 2026年3月19日 下午9:06


相关推荐

  • Shell nohup 命令详解

    Shell nohup 命令详解正文 nohupnohup 命令运行由 Command 参数和任何相关的 Arg 参数指定的命令 忽略所有挂断 SIGHUP 信号 在注销后使用 nohup 命令运行后台中的程序 要运行后台中的 nohup 命令 添加 amp 表示 and 的符号 到命令的尾部 nohup 是 nohangup 的缩写 就是不挂断的意思 nohup 命令 如果你正在运行一个进程 而且你觉得在退

    2026年3月26日
    3
  • 蚂蚁金服 SOFAArk 0.6.0 新特性介绍 | 模块化开发容器

    蚂蚁金服 SOFAArk 0.6.0 新特性介绍 | 模块化开发容器

    2021年7月3日
    140
  • idea插件安装和推荐插件

    idea插件安装和推荐插件idea安装lombok插件打开settings,进入插件页面,搜索lombok,安装安装完成先别重启,执行下图后重启

    2022年5月27日
    76
  • JPA 2.0 中的动态类型安全查询

    JPA 2.0 中的动态类型安全查询

    2021年9月2日
    52
  • 小明加密通道进入_德州人行通道闸哪个牌子好

    小明加密通道进入_德州人行通道闸哪个牌子好全高转闸有了高速发展的引擎,安保成为每个,地区重要的投入,很多重要的场所需要做到无人值守全天侯的安保措施,像、从事特殊行业作业的工厂、工地等场所就成了全高转闸十足的推动者,行业的迅速发展促生了一批又一批高速发展的企业,其中深圳市志美智能科技有限公司就是其中一家行业的全高转闸供应商。同时人脸识别技术,虹膜技术,掌纹识别技术,指纹识别技术,无线射频识别技术,条码识别技术等一些新技术的应用面的不断…

    2022年6月11日
    61
  • atop用法_atop linux 命令 在线中文手册

    atop用法_atop linux 命令 在线中文手册atop 简介本文要介绍的 atop 就是一款用于监控 Linux 系统资源与进程的工具 它以一定的频率记录系统的运行状态 所采集的数据包含系统资源 CPU 内存 磁盘和网络 使用情况和进程运行情况 并能以日志文件的方式保存在磁盘中 服务器出现问题后 我们可获取相应的 atop 日志文件进行分析 atop 是一款开源软件 我们可以从这里获得其源码和 rpm 安装包 一 atop 使用方法在安装 atop 之后 我们在命令行

    2025年11月4日
    8

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号