阿里云做的网站为啥没有ftp,建设网站桫椤在室内能,网站开发前端指什么,网站制作 客户刁难我的代码是没问题的#xff0c;因为之前popup没有问题#xff0c;换了笔记本#xff0c;重新安装了hbuilderx#xff0c;现在uni-popup在页面的底端都显示出来了#xff0c; 原因#xff1a;uni-popup插件问题#xff0c; 解决#xff1a;我卸载hbuilder重新下了一遍因为之前popup没有问题换了笔记本重新安装了hbuilderx现在uni-popup在页面的底端都显示出来了 原因uni-popup插件问题 解决我卸载hbuilder重新下了一遍再运行项目就没有问题了
一篇比较中肯的链接可以参考 参考 1、#插件讨论# 【 Popup 弹出层 - DCloud 】使用出错TypeError: Cannot read property ‘open’ of undefined 2、解决uni-app官方弹框popup关闭不了问题/pages/extUI/popup/popupuni-app弹框popup打开调用事件。unin-app弹框封装
如果网上提供的代码思路解决不了代码本身没有问题可以试试 1、关闭hbuilderx 和微信开发者工具重新运行项目 2、重新编译项目 3、重新安装插件 4、卸载重装hbuilderx ,根据需要看看是不是卸载重装微信开发者工具 5、版本匹配和兼容性 6、重新安装依赖删除node_modules 和 package-lock.json
npm cache clean --force
npm install 以下内容可以不用看 仅作记录
报错一 vendor.js? [sm]:2190 [Vue warn]: Error in onLoad hook: “TypeError: Cannot read property ‘0’ of undefined” 报错二 (found in pages/home/home.vue)(env: Windows,mp,1.06.2308310; lib: 3.1.5) warn vendor.js? [sm]:2190 Vue.config.errorHandler vendor.js? [sm]:7376 globalHandleError vendor.js? [sm]:3457 handleError vendor.js? [sm]:3426 invokeWithErrorHandling vendor.js? [sm]:3449 Vue.__call_hook vendor.js? [sm]:7433 pageOptions.methods.onLoad vendor.js? [sm]:1459 setTimeout (async) doWhenAllScriptLoaded VM740:1742 scriptLoaded VM740:1759 (anonymous) VM740:1784 Promise.then (async) (anonymous) VM740:1805 (anonymous) VM740:1809 vendor.js? [sm]:7377 TypeError: Cannot read property ‘0’ of undefined 报错三 TypeError: Cannot read property ‘open’ of undefined
uni-popup refpopup typecenterview classshow/view
/uni-popup onLoad(options) {this.getStorageToken()this.getPhoneHeight()
}, getStorageToken() {this.value uni.getStorageSync(token);if (this.value ! null) {this.close()} else {this.open()}
}, open() {this.$refs.popup.open(center)
},
close() {console.log(this.$refs)console.log(this.$refs[popup])console.log(this.$refs.popup[0]) //报错二是因为popup没有在循环里不能这么取this.$refs.popup.close()
},