Skip to content
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"
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>carbon-tutorial-vue</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
21 changes: 18 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
<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>
<style lang="scss">
@import './styles/carbon';
</style>

<script>
import TutorialHeader from './components/TutorialHeader';

export default {
name: 'App',
components: {
TutorialHeader
}
};
</script>
34 changes: 34 additions & 0 deletions src/components/TutorialHeader/TutorialHeader.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<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>

<cv-header-nav>
<cv-header-menu-item to="/repos">Repositories</cv-header-menu-item>
</cv-header-nav>

<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>
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,6 +1,8 @@
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;

Expand Down
16 changes: 8 additions & 8 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: 'repo-page',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// this generates a separate chunk (repo-page.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () =>
import(/* webpackChunkName: "about" */ './views/About.vue')
import(/* webpackChunkName: "repo-page" */ './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.

3 changes: 3 additions & 0 deletions src/views/LandingPage/LandingPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<div>LANDING PAGE</div>
</template>
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;
3 changes: 3 additions & 0 deletions src/views/RepoPage/RepoPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<div>REPO PAGE</div>
</template>
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;