mirror of
https://gitee.com/blossom-editor/blossom.git
synced 2025-12-06 16:58:26 +08:00
chore: 是否文章判断
This commit is contained in:
parent
742ff035c1
commit
1b437b371b
@ -1,3 +1,4 @@
|
|||||||
|
import { isNull } from '@renderer/assets/utils/obj'
|
||||||
import Notify from '@renderer/scripts/notify'
|
import Notify from '@renderer/scripts/notify'
|
||||||
import { isEmpty } from 'lodash'
|
import { isEmpty } from 'lodash'
|
||||||
import { Ref } from 'vue'
|
import { Ref } from 'vue'
|
||||||
@ -36,6 +37,21 @@ export enum SortLevelColor {
|
|||||||
FOUR = '#4AA40E93'
|
FOUR = '#4AA40E93'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断文档是否是文章
|
||||||
|
* @param doc
|
||||||
|
* @returns true: 是文章; false: 不是文章
|
||||||
|
*/
|
||||||
|
export const isArticle = (doc: DocInfo | undefined): boolean => {
|
||||||
|
if (isNull(doc)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (isNull(doc!.type) || doc!.type != 3) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过标题等级计算颜色
|
* 通过标题等级计算颜色
|
||||||
* @param level 标题等级
|
* @param level 标题等级
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user