MADE-Apps

Made vue blades

<img src="https://github.com/MADE-Apps/MADE-Vue/blob/main/assets/ProjectBanner.png" alt="MADE Vue project banner" />

Version Version: 0.1.0-alpha.6 Version Updated: 05/08/2022 By: MADE-Apps License: MIT

DownloadsLast30Days: 12

https://github.com/MADE-Apps/MADE-Vue

npm i made-vue-blades
yarn add made-vue-blades
MADE Vue project banner

MADE Vue - Blades

License - MIT Build - GitHub Actions Source - npmjs npm

A Vue 3 blade layout component, a UI pattern most commonly seen in the Microsoft Azure portal.

MADE Vue Blade Component

Usage

To customise the blade layout, you'll want to import the scss styling:

import "made-vue-blades/styles.scss";

In your main file, you can import the component:

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

import Blades from "made-vue-blades";

const app = createApp(App);
...
app.use(Blades);
...
app.mount("#app");

You can then reference the blade layout component in your app:

<template>
  <m-blade-layout :blades="blades">
    <template v-for="blade in blades" v-slot:[blade.key] :key="blade.key">
      <div>
        <p>This is some content from {{ blade.title }}</p>
        <button class="made-blade-button" @click="onCreateBlade">
          Create another blade
        </button>
      </div>
    </template>
  </m-blade-layout>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "App",
  data() {
    return {
      blades: [
        {
          key: "blade1",
          title: "Blade 1",
          canClose: false,
        },
      ],
    };
  },
  watch: {},
  methods: {
    onCreateBlade() {
      var currentIndex = this.blades.length;
      this.blades.push({
        key: "blade" + (currentIndex + 1),
        title: "Blade " + (currentIndex + 1),
        canClose: true,
      });
    },
  },
});
</script>

Copyright © 2020 vuejscomponent.com