jichoi / calendar star
박정하 박정하 06-26
250626 박정하 공통함수 추가
@ca8f21d1024eab198a0869595f26d71f078d74c6
 
client/resources/js/cmmnPlugin.js (added)
+++ client/resources/js/cmmnPlugin.js
@@ -0,0 +1,16 @@
+export default {
+  install(Vue) {
+    // 빈값체크
+    Vue.config.globalProperties.$isEmpty = function (data) {
+      if (data === undefined || data === null || data === "" || data.length === 0 || (data.constructor == Object && Object.keys(data).length === 0)) {
+        if ((typeof data) === "number") {
+          return false
+        } else {
+          return true;
+        }
+      } else {
+        return false;
+      }
+    }
+  },
+}(파일 끝에 줄바꿈 문자 없음)
client/views/index.js
--- client/views/index.js
+++ client/views/index.js
@@ -8,9 +8,12 @@
 import AppRouter from './pages/AppRouter.js';
 import App from './pages/App.vue';
 import store from "./pages/AppStore.js";
+import cmmnPlugin from '../resources/js/cmmnPlugin.js'
 import "../resources/scss/main.scss";
 
 
-const vue = createApp(App).use(AppRouter).use(store).mount('#root');
-
-
+const vue = createApp(App)
+  .use(AppRouter)
+  .use(store)
+  .use(cmmnPlugin)
+  .mount('#root');
(파일 끝에 줄바꿈 문자 없음)
Add a comment
List