修改文章的时候,编辑器载入内容的时候报这个错误,谁知道这是咋回事
Cannot read properties of undefined (reading 'length')
- 发布:2024-01-31 01:32
- 更新:2024-02-01 20:43
- 阅读:175
uni-cms 修改文章的时候,编辑器载入内容的时候报错
龙晓宝 (作者)
{
"ops": [
{
"insert": "1电风扇地方\n"
},
{
"attributes": {
"data-custom": "source=https://mp-80ba0437-ed6a-4ad7-acc5-6c1d4af2d6a1.cdn.bspapp.com/cloudstorage/2f214c7a-4da5-4720-8d06-16773dfba183.jpg"
},
"insert": {
"image": "https://mp-80ba0437-ed6a-4ad7-acc5-6c1d4af2d6a1.cdn.bspapp.com/cloudstorage/2f214c7a-4da5-4720-8d06-16773dfba183.jpg"
}
},
{
"insert": "\n\n\n"
}
]
}
这个数据是没安装前端那个插件的数据,可以正常修改
[
{
"type": "paragraph",
"data": [
{
"type": "text",
"data": {
"value": "1电风扇地方",
"attributes": {},
"class": "",
"style": ""
}
}
],
"class": "",
"style": ""
},
{
"type": "paragraph",
"data": [
{
"type": "image",
"data": {
"value": "https://mp-80ba0437-ed6a-4ad7-acc5-6c1d4af2d6a1.cdn.bspapp.com/cloudstorage/2f214c7a-4da5-4720-8d06-16773dfba183.jpg",
"attributes": {
"data-custom": "source=https://mp-80ba0437-ed6a-4ad7-acc5-6c1d4af2d6a1.cdn.bspapp.com/cloudstorage/2f214c7a-4da5-4720-8d06-16773dfba183.jpg"
},
"class": "",
"style": ""
}
}
],
"class": "",
"style": ""
},
{
"type": "paragraph",
"data": [
{
"type": "br"
}
],
"class": "",
"style": ""
},
{
"type": "paragraph",
"data": [
{
"type": "br"
}
],
"class": "",
"style": ""
}
]
这个是安装完前端插件,建立了config文件和上传完云端uni-cms-articles.schema.ext.js这个文件以后,再在后台修改的时候,数据就变成上面的数据了,就不能修改了报下面这个错误
Cannot read properties of undefined (reading 'length')
龙晓宝 (作者)
版本号是,1.0.18,本地和云端都一样都是报这个
2024-02-01 19:18
龙晓宝 (作者)
由于我刚接触uniapp这个玩意不了解,临时解决方法就这么写的
修改这个文件中的 uni-cms-articles.schema.ext.js方法
function getRenderableArticleContent (rawArticleContent, clientInfo) {
const isUniAppX = /uni-app-x/i.test(clientInfo.userAgent)
const isAdminManage = clientInfo.appId === "UNIC39DF18"
2024-02-01 22:09
DCloud_uniCloud_CRL
回复 龙晓宝: 在 uni-cms 配置文件里配置下 clientAppIds, 看下文档
2024-02-19 11:20