일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- javascript
- Klaytn
- 앵커링
- nodejs
- 웹
- vue.js
- geth구현
- Web
- web3.js
- 솔리디티
- 접근제어자
- kas
- frontend
- vue
- 서비스체인
- 프레임워크
- 클레이튼
- API
- 블록체인 구조와 이론
- SCN
- 블록체인
- 프론트엔드
- Solidity
- 제어자
- 이더리움
- Klaytn API Service
- blockchain
- ethereum
- Geth
- web3
Archives
- Today
- Total
BloCCat
layout 적용 본문
1. components / layout / Header.vue 생성
2.bootstrap 사용
npm install vue bootstrap-vue bootstrap
3.main.js 수정
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
// Import Bootstrap an BootstrapVue CSS files (order is important)
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
// Make BootstrapVue available throughout your project
Vue.use(BootstrapVue)
// Optionally install the BootstrapVue icon components plugin
Vue.use(IconsPlugin)
Vue.config.productionTip = false
new Vue({
router,
render: h => h(App),
}).$mount('#app')
4. Header.vue 작성
<template>
<div>
<b-navbar toggleable="lg" type="dark" variant="info">
<b-navbar-brand href="#">NavBar</b-navbar-brand>
<b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
<b-collapse id="nav-collapse" is-nav>
<b-navbar-nav>
<b-nav-item href="#">Link</b-nav-item>
<b-nav-item href="#" disabled>Disabled</b-nav-item>
</b-navbar-nav>
<!-- Right aligned nav items -->
<b-navbar-nav class="ml-auto">
<b-nav-form>
<b-form-input size="sm" class="mr-sm-2" placeholder="Search"></b-form-input>
<b-button size="sm" class="my-2 my-sm-0" type="submit">Search</b-button>
</b-nav-form>
<b-nav-item-dropdown text="Lang" right>
<b-dropdown-item href="#">EN</b-dropdown-item>
<b-dropdown-item href="#">ES</b-dropdown-item>
<b-dropdown-item href="#">RU</b-dropdown-item>
<b-dropdown-item href="#">FA</b-dropdown-item>
</b-nav-item-dropdown>
<b-nav-item-dropdown right>
<!-- Using 'button-content' slot -->
<template #button-content>
<em>User</em>
</template>
<b-dropdown-item href="#">Profile</b-dropdown-item>
<b-dropdown-item href="#">Sign Out</b-dropdown-item>
</b-nav-item-dropdown>
</b-navbar-nav>
</b-collapse>
</b-navbar>
</div>
</template>
<script>
export default{
name: "header"
}
</script>
<template> : html 코드 = 디자인
<script> : javascript 코드 = 데이터 바인딩
5. src / views 폴더 생성
6. App.vue 수정
<template>
<div id="app">
<Header />
<div id="content" class="content">
<router-view></router-view>
</div>
</div>
</template>
<script>
import Header from './components/layout/Header.vue'
export default {
name: 'App',
components: {
Header,
}
}
</script>
<style>
</style>
7. src /views/Home.vue 작성
<template>
<div>
<h1>Welcome to {{title}}!</h1>
</div>
</template>
8. router.js 작성
import Vue from "vue";
import VueRouter from "vue-router";
import Home from "./views/Home";
import About from "./views/About";
Vue.use(VueRouter);
const router = new VueRouter({
mode: "history",
routes: [
{path:"/",component: Home},
{path:"/about", component: About}
]
})
export default router;
9.서버 실행
npm run serve