0.1.0 • Published 2 years ago

v-layout-helpers v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

v-layout-helpers

Helper components for setting up a layout for your vuetify backed website.

Remark: Nuxt must be used in order to use the footer component, as it uses the nuxt-link component under-the-hood.

Installation

npm i v-layout-helpers

Create a new plugin: plugins/v-layout-helpers.js:

import Vue from "vue"
import { Breadcrumbs, Footer, Loading, SimpleTreeView, Header } from "v-layout-helpers"

Vue.component("Breadcrumbs", Breadcrumbs)
Vue.component("Footer", Footer)
Vue.component("Loading", Loading)
Vue.component("SimpleTreeView", SimpleTreeView)
Vue.component("Header", Header)

Register the plugin under assets/configs/nuxt.js (or when using a fresh nuxt install nuxt.conf.js in the main project folder):

import { components as vlhComponents, directives as vlhDirectives } from "v-layout-helpers/assets/treeshake"
const plugins = [
  ...
  {
    src: "@/plugins/v-layout-helpers.js",
    mode: "client"
  },
  ...
]
..
let treeShakeComponents = [...vscmsComponents, ...vlhComponents, ...vesComponents]
let treeShakeDirectives = [...vscmsDirectives, ...vlhDirectives, ...vesDirectives]

const vuetify = {
  customVariables: ["~/assets/style/variables.scss"],
  treeShake: {
    components: Array.from(new Set(treeShakeComponents)),
    directives: Array.from(new Set(treeShakeDirectives))
  },
  ..
}
..

BreadCrumbs

Props

props: {
  pages: {
    type: Array as PropType<Array<string>>,
    required: true
  }
}

Footer

Props

props: {
  text: {
    type: String,
    default: "Footer Text"
  },
  links: {
    type: Array as PropType<Array<FooterLink>>,
    default: () => ([])
  },
  chips: {
    type: Array as PropType<Array<FooterChip>>,
    default: () => ([])
  },
  infoIcons: {
  type: Array as PropType<Array<FooterIcon>>,
  default: () => ([])
}
}

Loading

props: {
  max: {
    type: Number,
    default: 125
  },
  jump: {
    type: Number,
    default: 25
  },
  timeInterval: {
    type: Number,
    default: 2000
  }
}

SimpleTreeView

props: {
  items: {
    type: Array as PropType<TreeViewItem[]>,
    default: () => ([])
  },
  anchor: {
    type: Object
  }

TreeViewItem structure:

interface TreeViewItem {
  name: string,
  action: any,
  style: string,
  class: string,
  path?: string,
  icon: string,
  children: TreeViewItem[]
}

Remark 1: items prop is a list of tree-view items representing pages in your website. The automatically generated children (or the ones that are passed) represent header tags in your HTML page. Reamkrk 2: anchor prop is a Vue reference to a page/container containing all the items to be automatically generated as items in the tree-view.

0.0.40

2 years ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.44

2 years ago

0.0.45

2 years ago

0.0.46

2 years ago

0.0.47

2 years ago

0.0.37

2 years ago

0.0.38

2 years ago

0.0.39

2 years ago

0.0.30

2 years ago

0.0.31

2 years ago

0.0.32

2 years ago

0.0.33

2 years ago

0.0.34

2 years ago

0.0.35

2 years ago

0.0.36

2 years ago

0.1.0

2 years ago

0.0.29

2 years ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.25

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.26

2 years ago

0.0.27

2 years ago

0.0.28

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago