1.1.1 • Published 5 years ago

vue-radial-menu v1.1.1

Weekly downloads
94
License
MIT
Repository
-
Last release
5 years ago

vue-radial-menu

Simple radial menu for vue2 apps

Image

Installation

npm i vue-radial-menu --save

Basic usage

Menu in automatic mode :

<template>
  <div id="app">
    <radial-menu
      style="margin: auto; margin-top: 300px; background-color: white"
      :itemSize="50"
      :radius="120"
      :angle-restriction="180">
        <radial-menu-item 
          v-for="(item, index) in items" 
          :key="index" 
          style="background-color: white" 
          @click="() => handleClick(item)">
          <span>{{item}}</span>
        </radial-menu-item>
      </radial-menu>
      <div style="color: rgba(0,0,0,0.6); margin-top: 16px;">{{ lastClicked }}</div>
  </div>
</template>

<script>
import { RadialMenu,  RadialMenuItem } from 'vue-radial-menu'

export default {
  name: 'app',
  components: {
    RadialMenu,
    RadialMenuItem
  },
  data () {
    return {
      items: ['foo', 'bar', 'hello', 'world', 'more', 'items'],
      lastClicked: 'click on something!'
    }
  },
  methods: {
    handleClick (item) {
      this.lastClicked = item;
    }
  }
}
</script>

Options

RadialMenu props

Note that no prop is actually required. Also take note that no color is given to the menu by default, you would do well to add your own class for these kind of things.

NameTypeDefault ValueDescription
openBooleanundefinedForce the menu to assume the given value. If this prop is not provided, the menu will handle the state on its own. Useful in cases where the user might want to make an action before displaying, i.e. displaying an overlay. Note that this can also be achieved by listening on the open and close events.
angle-restrictionNumber180The maximum angle in a circle for the items to be displayed in. A value of 90 would represent the quarter of a circle, 180 half a circle and so on.
sizeNumber50The size in pixels of the main button to open the menu.
itemSizeNumber36The size in pixels of menu items.
rotateNumber0An angle value to rotate the menu. Positive values will rotate the menu clockwise.
radiusNumber100The radius of the circle to form with the items.

RadialMenu events

NameParamsDescription
clicknoneTriggered when the main button is pressed.
opennoneTriggered when the menu is opened.
closenoneTriggered when the menu is closed.

RadialMenuItem

This component has no props that should be assigned by the user. This component only supports basic events.

Liscense

This project is under the MIT liscence.

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago