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>
7***@qq.com
- 发布:2020-09-28 18:01
- 更新:2021-11-19 13:55
- 阅读:2749
1 个回复
3***@qq.com - 半生四季
我也遇到这个问题了 你解决了嘛