vue 的DOMException問題


開發中遇見了

 

vue.runtime.esm.js:1888 DOMException: Failed to execute 'setAttribute' on 'Element': ')' is not a valid attribute name.
at baseSetAttr (http://localhost:3000/app.js:36065:8)
at setAttr (http://localhost:3000/app.js:36040:5)
at Array.updateAttrs (http://localhost:3000/app.js:35995:7)
at invokeCreateHooks (http://localhost:3000/app.js:35349:22)
at createElm (http://localhost:3000/app.js:35236:11)
at createChildren (http://localhost:3000/app.js:35333:9)
at createElm (http://localhost:3000/app.js:35234:9)
at VueComponent.patch [as __patch__] (http://localhost:3000/app.js:35757:7)
at VueComponent.Vue._update (http://localhost:3000/app.js:33229:19)
at VueComponent.updateComponent (http://localhost:3000/app.js:33350:10)

 

 

這樣的一個問題,都不能具體定位到錯誤的位置,后來通過代碼管理工具對比代碼才發現

 

    <li class="unselect-item" @click="more" )>更多篩選</li>
 
這段代碼多了一個右括號導致問題出現,再網上看了一些人遇見的問題,有的是標簽屬性多了個豆號什么的,所以一旦出現DOMException這樣的問題,可以先從標簽上看一下是不是哪里多寫了或者寫錯了什么東西導致的問題出現,從標簽開始排查


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM