今天用Layui開發的時候突然遇到一個表格渲染出錯的問題。js報錯 Uncaught TypeError: Cannot create property 'key' on boolean 'true' , 原始碼壓縮後我是看不懂,後面搜社群的時候找到問題所在,文件 cols: [] 不行 用示例的 [[ ]] 解決。 權引用自 Fly社群
例子
var tableIn = table.render({ ···省略··· cols: [ {field: 'id', title: '{:lang("id")}', width: 80, fixed: true}, {field: 'title', title: '公告名稱', width: 400,templet: '#title'}, ], ···省略··· }); //改成 var tableIn = table.render({ ···省略··· cols: [[ {field: 'id', title: '{:lang("id")}', width: 80, fixed: true}, {field: 'title', title: '公告名稱', width: 400,templet: '#title'}, ]], ···省略··· });
(排坑) Cannot create property 'key' on boolean 'true'
相關文章
- vue 踩坑記錄 cannot read property xxx of undefinedVueUndefined
- Cannot set property 'innerHTML' of nullHTMLNull
- Cannot read property ‘aDataSort‘ of undefinedUndefined
- Cannot set property ‘type‘ of null(vue)NullVue
- BUG——AngularJS:Cannot set property ‘pic‘ of undefinedAngularJSUndefined
- js提示Cannot read property ‘replace‘ of undefinedJSUndefined
- echarts:Uncaught TypeError: Cannot read property '0' of undefinedEchartsErrorUndefined
- 前端報錯:cannot read property length of undefined前端Undefined
- hive orc表'orc.create.index'='true'與'orc.create.index'='false'HiveIndexFalse
- vue+echarts報錯Cannot read property ‘init‘ of underfinedVueEcharts
- [Vue warn]: Invalid prop: type check failed for prop "unlinkPanels". Expected Boolean, got String with value "true".VueAIBooleanGo
- 執行專案報錯Cannot read property 'styles' of undefinedUndefined
- el-tree 報錯 TypeError: Cannot read property ‘setCheckedKeys‘ of undefined“ErrorUndefined
- [譯] 避免那些可惡的 "cannot read property of undefined" 錯誤Undefined
- 使用req.session.xxx時出現 Cannot set property ‘xxxx‘ of undefinedSessionUndefined
- spring中<context:property-placeholder/>一個坑SpringContext
- JDBC踩坑──`tinyint(1)`預設對應Java中的`Boolean`JDBCJavaBoolean
- 開發中遇到的bug-Cannot set property ‘__VUE_DEVTOOLS_UID__‘ of nullVuedevUINull
- vue-router.esm.js?fe87:2210 TypeError: Cannot read property ‘$createElement‘ of undefinedVueJSErrorUndefined
- [Vue warn]: Error in render: "TypeError: Cannot read property 'matched' of undefined" found in <App> at src/App.vueVueErrorUndefinedAPP
- vue 中引用echarts 初始化init undefind問題(Cannot read property ‘init‘ of undefined)VueEchartsUndefined
- JavaScript Boolean()JavaScriptBoolean
- Redis 修改過期 key 的一個坑Redis
- AndroidStudio之自定義輸出包名報錯 Cannot set the value of read-only property 'outputFile' forAndroid
- 【爬坑日記】vue中傳props時預設為Boolean問題VueBoolean
- 建立外來鍵時報 Cannot add foreign key constraint 解決方法AI
- CMake Error: add_executable cannot create target ““ because another target with the same name已解決Error
- JavaScript Boolean 物件JavaScriptBoolean物件
- Java更新資料庫報錯:Data truncation: Cannot create a JSON value from a string with CHARACTER SETJava資料庫JSON
- 用實數作為 HashMap 的key,被坑哭了HashMap
- 在專案中應該使用Boolean還是使用boolean?Boolean
- JavaScript Boolean物件 valueOf()JavaScriptBoolean物件
- JavaScript Boolean物件 toString()JavaScriptBoolean物件
- 排坑之旅——動態代理給Spring事務種下的坑Spring
- Windows nvm的安裝使用(及排坑)Windows
- SAP 使用BP建立供應商報錯 - You cannot create a vendor with grouping G001 - 對策
- 走進 JDK 之 BooleanJDKBoolean
- java 原始碼分析 —BooleanJava原始碼Boolean