Skip to content
TheChatArchiveThe Chat Archive
gpt-4-0314· openaiHugging Face Suzhen/CodeChat

Can you provide code for a personal portfolio website using vuejs, vuetify and typescript?

  1. User

    Can you provide code for a personal portfolio website using vuejs, vuetify and typescript?

  2. 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.

    1. Make sure you have Node.js installed, and install Vue CLI globally using npm:
    npm install -g @vue/cli
    
    1. Create a new Vue.js project using the CLI with Vuetify and TypeScript.
    vue create my-portfolio
    

    Choose "Manually select features" and select "TypeScript" and "CSS Pre-processors" in the feature list. After the project creation, navigate to the my-portfolio folder:

    cd my-portfolio
    
    1. Add Vuetify to the project:
    vue add vuetify
    
    1. Now, let's create a simple layout for your personal portfolio website. Replace src/App.vue with 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>
    
    1. 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,
      },
    ];
    
    1. 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>
    
    1. Finally, start your development server with:
    npm run serve
    

    You 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.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.