ํฐ์คํ ๋ฆฌ ๋ทฐ
๐ฌ iframe(HTML Inline Frame) ์ด๋
ํด๋น ์น ํ์ด์ง ์์ ๋ค๋ฅธ ํ์ด์ง๋ฅผ ๋ถ๋ฌ์์ ์ฝ์ ํ ์ ์๋ค.
๐ ํ๋ก์ ํธ ๊ตฌ์ฑ ๋ฐฉ์
์ง๊ธ ์งํํ๋ ํ๋ก์ ํธ๋ main-proejct / dev-project ๋ก ์๋น์ค๋ฅผ ๋๋ ์ ๊ตฌ์ฑํ๋ค.
Main Project : ๋ก๊ทธ์ธ, ๋ฉ๋ด, ์ฌ์ฉ์, ๊ฐ ์๋น์ค iframe ์ฐ๊ฒฐ์ ๊ด๋ฆฌํ๋ ํ๋ก์ ํธ
Dev Project : ๊ฐ๋ฐํ๋ ํ๋ฉด์ ๊ด๋ฆฌํ๋ ํ๋ก์ ํธ (iframe์์ ๋ค์ด๊ฐ)
๐ ํ๋ก์ ํธ ์คํ
Main / Dev ํ๋ก์ ํธ๋ฅผ ์คํํ๊ณ (npm run serve)
Main Url๋ก ์ ์ํ ํ, Dev ์๋น์ค๋ฅผ iframe์ผ๋ก ํธ์ถํ๋ค.
๐ Main Project์ Template
<template>
<div class="h-100">
<iframe ref="iframeRef" :name="name" :src="`${url}?${queryString}`" frameborder="0" class="w-100 h-100" @load="load"> </iframe>
</div>
</template>
<script>
// ... ์๋ต
computed: {
queryString() {
const params = { ...this.iframeParam, ...this.screenParam };
const str = Object.entries(params)
.map(e => e.join('=')
.join('&');
return str;
}
}
</script>
src์ Dev ์๋น์ค์ ๋ผ์ฐํธ๋ฅผ ๋ฃ์ด์ค๋ค.
โ name : iframe์ name
โ url : iframe ํธ์ถ ์ฃผ์ (Dev-Project ์ฃผ์)
โ iframeParam : iframe์ ํ์ธ QueryString ๊ฐ์ฒด
โ screenParam : Menu ์์ฝ๋ฉ์์ ์ฌ์ฉ์ค์ธ ๋ชจ๋ iframe์ ๊ณตํต QueryString ๊ฐ์ฒด (ํฐํธ,์ธ์ด ๋ฑ)
๐ ํ๋ก์ ํธ ์คํ
Main / Dev ํ๋ก์ ํธ๋ฅผ ์คํํ๊ณ (npm run serve)
Main Url๋ก ์ ์ํ ํ, Dev ์๋น์ค๋ฅผ iframe์ผ๋ก ํธ์ถํ๋ค.
๐ ํ๋ก์ ํธ ๊ตฌ์กฐ
Main Url (Network) : http://xx.xx.xx.82:8081
Dev Url (Network) : http://ee.ee.ee.82:3001
๋ฉ๋ด๋ฅผ ๋๋ฅผ ๋๋ง๋ค main์ ๋์ผํ๊ณ , iframe์์ src๋ง ๋ณ๊ฒฝ๋๋ฉฐ ํ๋ฉด์ ํธ์ถํ๋ค.
๐ Main/Dev ํ๋ก์ ํธ์ routes
โผ Main Project์ routes.js
const LoginLayout = () => import('@/views/Layout/Login/LoginLayout.vue');
const LoginPage = () => import('@/views/Pages/Login/LoginPage.vue');
const InitPasswordForm = () => import('@/views/Pages/Login/Content/InitPasswordForm.vue');
const ResetForm = () => import('@/views/Pages/Login/Content/ResetForm.vue');
const routes = [
{
path: '/',
name: '',
redirect: '/login',
component: LoginLayout,
children: [
//๋ก๊ทธ์ธ ํ์ด์ง
{
path: '/login',
name: 'Login',
component: LoginPage
},
//๋น๋ฐ๋ฒํธ ์ด๊ธฐํ ํ์ด์ง
{
path: '/initPassword',
name: 'InitPassword',
component: InitPasswordForm
},
//๋น๋ฐ๋ฒํธ ๋ณ๊ฒฝ ํ์ด์ง
{
path: '/reset',
name: 'Reset',
component: ResetForm
}
]
},
];
export default routes;
โผ Dev Project์ routes.js
// ๊ธฐ๋ณธ ๋ ์ด์์
const DefaultLayout = () => import('@common/Layout/DefaultLayout');
// ๋ชจ๋ํฐ๋ง
const RealtimeCollectionStatus = () => import('@common/Monitoring/RealtimeCollectionStatus/RealtimeCollectionStatus.vue');
const AlarmHistory = () => import('@common/Monitoring/AlarmHistory/AlarmHistory.vue');
// ์ถ๊ฐํ ํ์ด์ง Route ์ ๋ณด
const children = [
{
path: '/RealtimeCollectionStatus',
component: RealtimeCollectionStatus
},
{
path: '/alarmHistory',
component: AlarmHistory
}
]
const routes = [
{
path: '/',
component: DefaultLayout,
children
}
];
export default routes;
'FrontEnd > Vue' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Vue 3] ์ปดํฌ๋ํธ์ ํต์ (props, emit) (0) | 2023.11.22 |
---|---|
[Vue 3] Vue.js ๊ธฐ๋ณธ ๊ฐ๋ ๊ณผ ๋ฌธ๋ฒ (0) | 2023.11.22 |
[Vue 3] Vue 3 ์๊ฐ(vs Vue 2) , ํต์ฌ ๋์ ์๋ฆฌ(Reactivity) (0) | 2023.11.22 |
[Vue] scss ์ฌ์ฉํ๊ธฐ (์๋ฌํด๊ฒฐ) (0) | 2023.10.25 |
[ Vue ] process.env ์ฌ์ฉ์ undefined ์ค๋ฅ (0) | 2023.06.20 |
- Total
- Today
- Yesterday
- Chart
- npm install
- Legend
- x์ถ์คํฌ๋กค
- web
- package-lock
- piechart
- SASS
- Figma Style
- BarChart
- figma
- SCSS
- Figma ๋ฒํผ
- echarts
- javascript
- package
- vscode
- ๊ฐ์ฒด
- ๊น์๋ณต์ฌ
- frontend
- Vscode๋จ์ถํค
- ํ๋ก ํธ์๋
- Figma ๊ธฐ์ด
- ํ๊ฒฝ์ค์
- npm
- VUE
- Location
- ๊ฐ์ฒด๋ณต์ฌ
- chartjs
- ์์๋ณต์ฌ
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |