Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tutorial): complete step 1 #1371

Open
wants to merge 1 commit into
base: vue-step-1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SASS_PATH=./node_modules
20 changes: 17 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
<template>
<div id="app">
Hello Carbon! Well, not quite yet. This is the starting point for the Carbon
tutorial.
<tutorial-header />
<cv-content id="#main-content">
<router-view />
</cv-content>
</div>
</template>

<style lang="scss"></style>
<script>
import TutorialHeader from './components/TutorialHeader';
export default {
name: 'App',
components: {
TutorialHeader
}
};
</script>

<style lang="scss">
@import './styles/carbon';
</style>
39 changes: 39 additions & 0 deletions src/components/TutorialHeader/TutorialHeader.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<template>
<cv-header aria-label="Carbon tutorial">
<cv-skip-to-content href="#main-content"
>Skip to content</cv-skip-to-content
>

<cv-header-name to="/" prefix="IBM">Carbon Tutorial</cv-header-name>
<div class="divider">|</div>
<cv-header-menu-item to="/repos">Repositories</cv-header-menu-item>

<template slot="header-global">
<cv-header-global-action aria-label="Notifications">
<notification-20 />
</cv-header-global-action>
<cv-header-global-action aria-label="User avatar">
<user-avatar-20 />
</cv-header-global-action>
<cv-header-global-action aria-label="App switcher">
<app-switcher-20 />
</cv-header-global-action>
</template>
</cv-header>
</template>

<script>
import { Notification20, UserAvatar20, AppSwitcher20 } from '@carbon/icons-vue';
export default {
name: 'TutorialHeader',
components: { Notification20, UserAvatar20, AppSwitcher20 }
};
</script>

<style lang="scss">
.divider {
height: 24px;
width: 1px;
background-color: #3d3d3d;
}
</style>
2 changes: 2 additions & 0 deletions src/components/TutorialHeader/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import TutorialHeader from './TutorialHeader';
export default TutorialHeader;
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Vue from 'vue';
import App from './App.vue';
import router from './router';
import CarbonComponentsVue from '@carbon/vue';

Vue.use(CarbonComponentsVue);
Vue.config.productionTip = false;

new Vue({
Expand Down
12 changes: 6 additions & 6 deletions src/router.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import Vue from 'vue';
import Router from 'vue-router';
import Home from './views/Home.vue';
import LandingPage from './views/LandingPage';

Vue.use(Router);

export default new Router({
routes: [
{
path: '/',
name: 'home',
component: Home
name: 'landing-page',
component: LandingPage
},
{
path: '/about',
name: 'about',
path: '/repos',
name: 'repos-page',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () =>
import(/* webpackChunkName: "about" */ './views/About.vue')
import(/* webpackChunkName: "about" */ './views/RepoPage')
}
]
});
1 change: 1 addition & 0 deletions src/styles/_carbon.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import 'carbon-components/scss/globals/scss/styles';
5 changes: 0 additions & 5 deletions src/views/About.vue

This file was deleted.

9 changes: 0 additions & 9 deletions src/views/Home.vue

This file was deleted.

11 changes: 11 additions & 0 deletions src/views/LandingPage/LandingPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<div>LANDING PAGE</div>
</template>

<script>
export default {
name: 'LandingPage'
};
</script>

<style lang="scss"></style>
2 changes: 2 additions & 0 deletions src/views/LandingPage/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import LandingPage from './LandingPage';
export default LandingPage;
11 changes: 11 additions & 0 deletions src/views/RepoPage/RepoPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<div>REPO PAGE</div>
</template>

<script>
export default {
name: 'LandingPage'
};
</script>

<style lang="scss"></style>
2 changes: 2 additions & 0 deletions src/views/RepoPage/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import RepoPage from './RepoPage';
export default RepoPage;