7***@qq.com
7***@qq.com
  • 发布:2020-09-28 18:01
  • 更新:2021-11-19 13:55
  • 阅读:2749

Error in v-on handler: "TypeError: this.$refs.office.openFile is not a function"

分类:uni-app

Error in v-on handler: "TypeError: this.$refs.office.openFile is not a function"是什么错误,代码如下:

<template> <div> <HG-OfficeReader-A ref = "office" width="100%" height="100%" style="width: 100%; height: 300px;" /> <button type="primary" @tap="openOnLineFile()">打开在线文档</button> <button type="primary" @tap="openlocalFile()">选择文件打开</button> <button type="primary" @tap="closeFile()">关闭</button> </div> </template> <script> export default { methods:{ openOnLineFile(){ this.$refs.office.openFile("https://cn.hprt.com/prt/files/download_first/id/726.html"); }, openlocalFile(){ this.$refs.office.openFile(""); }, closeFile(){ this.$refs.office.closeFile(); } } } </script> <style>
2020-09-28 18:01 负责人:无 分享
已邀请:
3***@qq.com

3***@qq.com - 半生四季

我也遇到这个问题了 你解决了嘛

该问题目前已经被锁定, 无法添加新回复