Can you provide code for a personal portfolio website using vuejs, vuetify and typescript?
- User
Can you provide code for a personal portfolio website using vuejs, vuetify and typescript?
- Assistant
While it's difficult to provide an entire personal portfolio website code in a single response, I can give you a starting point with a simple structure that you can expand on. You can also check the Vue.js documentation for more details on how to use Vue.js.
- Make sure you have Node.js installed, and install Vue CLI globally using npm:
npm install -g @vue/cli- Create a new Vue.js project using the CLI with Vuetify and TypeScript.
vue create my-portfolioChoose "Manually select features" and select "TypeScript" and "CSS Pre-processors" in the feature list. After the project creation, navigate to the
my-portfoliofolder:cd my-portfolio- Add Vuetify to the project:
vue add vuetify- Now, let's create a simple layout for your personal portfolio website. Replace
src/App.vuewith the following code:
<template> <v-app> <v-navigation-drawer app mini-variant> <v-list dense> <template v-for="(item, index) in menuItems"> <v-list-item :key="index" :to="item.link"> <v-list-item-icon> <v-icon>{{ item.icon }}</v-icon> </v-list-item-icon> <v-list-item-title>{{ item.title }}</v-list-item-title> </v-list-item> </template> </v-list> </v-navigation-drawer> <v-app-bar app> <v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon> <v-toolbar-title>My Portfolio</v-toolbar-title> <v-spacer></v-spacer> </v-app-bar> <v-main> <v-container fluid> <router-view></router-view> </v-container> </v-main> </v-app> </template> <script lang="ts"> import { Component, Vue } from "vue-property-decorator"; @Component export default class App extends Vue { drawer = false; menuItems = [ { title: "Home", icon: "mdi-home", link: { name: "Home" } }, { title: "Projects", icon: "mdi-briefcase", link: { name: "Projects" } }, { title: "Contact", icon: "mdi-email", link: { name: "Contact" } }, ]; } </script> <style> html, body, #app { height: 100%; width: 100%; margin: 0; } </style>- Add the following routes to your
src/router/index.ts:
import Home from "../views/Home.vue"; import Projects from "../views/Projects.vue"; import Contact from "../views/Contact.vue"; const routes: Array<RouteConfig> = [ { path: "/", name: "Home", component: Home, }, { path: "/projects", name: "Projects", component: Projects, }, { path: "/contact", name: "Contact", component: Contact, }, ];- Create new views inside the
src/views/folder for Home.vue, Projects.vue, and Contact.vue. Fill in your portfolio details:
<!-- Home.vue --> <template> <div> <h1>Welcome to My Portfolio</h1> <p>I'm [Your Name], a [Your Profession]. Here's a brief introduction about myself and skills...</p> </div> </template> <!-- Projects.vue --> <template> <div> <h1>Projects</h1> <p>Here are some projects I've worked on...</p> </div> </template> <!-- Contact.vue --> <template> <div> <h1>Contact Me</h1> <p>Please feel free to reach out to me...</p> </div> </template>- Finally, start your development server with:
npm run serveYou can now develop your personal portfolio website by adding your content and styling it to your liking. Don't forget to check the Vue.js and Vuetify documentation for more components and options.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.