mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-06-11 12:49:30 +08:00
feat: 新增首页轮播支持配置
This commit is contained in:
@@ -160,6 +160,24 @@ const utils = {
|
||||
urls: list,
|
||||
loop: true
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 检查是否为json字符串
|
||||
* @param {Object} jsonStr 数据源
|
||||
*/
|
||||
checkJsonAndParse(jsonStr) {
|
||||
try {
|
||||
const jsonResult = JSON.parse(jsonStr);
|
||||
return {
|
||||
ok: true,
|
||||
jsonData: jsonResult,
|
||||
}
|
||||
} catch (e) {
|
||||
return {
|
||||
ok: false,
|
||||
jsonData: {},
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user