1.3.1 • Published 3 years ago

@coddicat/vue-hexagon v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

vue-hexagon

Vue component to render div element as hexagon with inner content

example:

https://vue-hexagon.coddicat.com/

Installation

npm i @coddicat/vue-hexagon

Usage

template:

<Hexagon
    @click="onClick"
    @mouseover="onMouseEvent"
    :size="150"
    :border-size="3"
    :background-image="`url(https://picsum.photos/id/20/100/100)`"
    border-color="#f00"
    class="hexagon-custom"
>
    <span style="color: #f0f">Inner Text</span>
</Hexagon>

type script:

import { Component, Vue } from "vue-property-decorator";
import Hexagon from "@coddicat/vue-hexagon";
@Component({
  name: "HexagonExample",
  components: {
    Hexagon
  }
})
export default class HexagonExample extends Vue { 
  public onClick(e: any): void {
    console.log(e);
  },
  public onMouseEvent(e: MouseEvent): void {
    console.log(e);
  }
}

Props

namerequireddescriptiondefault
borderSizenoborder width in px1.5
borderColornoborder colorblack
sizenowidth & height in px100
backgroundColornobackground colorwhite
backgroundImagenocontent imageempty
contentStylenocss style (not border)empty
contentClassnocss class (not border)empty

Events

  • click
  • mousedown
  • mouseup
  • mousewheel
  • mousemove
  • mouseenter
  • mouseover
  • mouseleave
  • mouseout
1.3.1

3 years ago

1.3.0

3 years ago

1.2.2

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago