diff --git a/src/common/common.js b/src/common/common.js index d1e4b91..9acd369 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -73,6 +73,14 @@ const common = { seconds: zeroFormat(date.getSeconds()), }; }, + + isNotEmpty(obj) { + if (obj === null || obj === undefined) return false; + if (typeof obj === 'string' && obj.trim() === '') return false; + if ((Array.isArray(obj) || obj === Object(obj)) && Object.keys(obj).length === 0) return false; + + return true; + }, }; export default { diff --git a/src/components/board/BoardCommentArea.vue b/src/components/board/BoardCommentArea.vue index ed153ab..6cf3f00 100644 --- a/src/components/board/BoardCommentArea.vue +++ b/src/components/board/BoardCommentArea.vue @@ -11,13 +11,9 @@ -->