
+++ client/resources/js/cmmnPlugin.js
... | ... | @@ -0,0 +1,16 @@ |
1 | +export default { | |
2 | + install(Vue) { | |
3 | + // 빈값체크 | |
4 | + Vue.config.globalProperties.$isEmpty = function (data) { | |
5 | + if (data === undefined || data === null || data === "" || data.length === 0 || (data.constructor == Object && Object.keys(data).length === 0)) { | |
6 | + if ((typeof data) === "number") { | |
7 | + return false | |
8 | + } else { | |
9 | + return true; | |
10 | + } | |
11 | + } else { | |
12 | + return false; | |
13 | + } | |
14 | + } | |
15 | + }, | |
16 | +}(파일 끝에 줄바꿈 문자 없음) |
--- client/views/index.js
+++ client/views/index.js
... | ... | @@ -8,9 +8,12 @@ |
8 | 8 |
import AppRouter from './pages/AppRouter.js'; |
9 | 9 |
import App from './pages/App.vue'; |
10 | 10 |
import store from "./pages/AppStore.js"; |
11 |
+import cmmnPlugin from '../resources/js/cmmnPlugin.js' |
|
11 | 12 |
import "../resources/scss/main.scss"; |
12 | 13 |
|
13 | 14 |
|
14 |
-const vue = createApp(App).use(AppRouter).use(store).mount('#root'); |
|
15 |
- |
|
16 |
- |
|
15 |
+const vue = createApp(App) |
|
16 |
+ .use(AppRouter) |
|
17 |
+ .use(store) |
|
18 |
+ .use(cmmnPlugin) |
|
19 |
+ .mount('#root');(파일 끝에 줄바꿈 문자 없음) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?