Skip to content

Commit

Permalink
fix(vue): fix routing files
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored and mandarini committed Sep 12, 2023
1 parent 5611f87 commit ab417e8
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,41 @@ import NxWelcome from './components/NxWelcome.vue';
<RouterLink to="/about">About</RouterLink>
</nav>
</header>

<RouterView />
<% } else { %>
<NxWelcome title="<%= title %>" />
<% } %>
</template>

<% if (routing && style !== 'none') { %>
<style scoped lang="<%= style %>">
header {
line-height: 1.5;
max-width: 100vw;
}

nav > a {
padding-left: 1rem;
padding-right: 1rem;
}

@media (min-width: 768px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
margin-left: auto;
margin-right: auto;
max-width: 768px;
}

nav {
text-align: left;
font-size: 1rem;

padding: 1rem 0;
margin-top: 1rem;
}
}
</style>
<% } %>
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<% if (style !== 'none') { %>
import './styles.<%= style %>';
<% } %>
<% if (routing) { %>
import router from './router';
<% } %>

import { createApp } from 'vue';
import App from './App.vue';

createApp(App).mount('#root');
const app = createApp(App);
<% if (routing) { %>
app.use(router);
<% } %>
app.mount('#root');
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
</template>

<style>
@media (min-width: 1024px) {
@media (min-width: 768px) {
.about {
min-height: 100vh;
display: flex;
align-items: center;
max-width: 768px;
margin-left: auto;
margin-right: auto;
padding: 0 1rem;
}
}
</style>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import TheWelcome from '../TheWelcome.vue'
import NxWelcome from '../components/NxWelcome.vue'
</script>

<template>
<main>
<TheWelcome />
<NxWelcome />
</main>
</template>

0 comments on commit ab417e8

Please sign in to comment.