0.3.9 • Published 4 months ago

dragandropvue v0.3.9

Weekly downloads
-
License
-
Repository
-
Last release
4 months ago

drag-and-drop-vue

The main usage of this package is for drag-and-drop functionality. The user create multiple sections and in that sections provide the facilities to create multiple cards. all cards are swapable and also drag and drop in any section. The user can also Edit and Delete card.

install

npm i dragandropvue
import { SimpleDragVue } from 'dragandropvue';

export default {
  // ...
  components: {
    SimpleDragVue
  }
  // ...
}

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Usage

value prop if passed should be a response object

<script>
data() {
    return {
      response: {
        data: [
    {
      title: "Section 1",
      drop_col_id: "",
      data: [
        { 
          title: 'Card 1',
          description: "<p>Description Of card<p>",
          attachment: null,
          deadlineDate: Deadline Date, 
        },
        { 
          title: 'Card 2',
          description: "<p>Description Of card<p>",
          attachment: null,
          deadlineDate: Deadline Date,
          },
        { 
          title: "Card 3",
          description: "<p>Description Of card<p>",
          attachment: null,
          deadlineDate: Deadline Date,
        },
      ],
    },
    {
      title: "Section 2",
      data: [
        { 
          title: 66, 
          description: "<p>Description Of card<p>",
          attachment: null,
          deadlineDate: Deadline Date,
        }
      ],
    },
    {
      title: "Section 3",
      data: [],
    },
  ],
      },
      modalOpened: false
    }
  },

</script>
<SimpleDragVue
  :responseData="response"
  :isModalOpened="modalOpened"
  addCardTitle="+Add Card"
  addSectionTitle="Add Section"
/>

Emits events

<SimpleDragVue
  :responseData="response"
  :isModalOpened="modalOpened"
  addCardTitle="+Add Card"
  addSectionTitle="Add Section"
  @add-card="addNewCardEvent"
  @edit-card="editCardEvent"
>

Available props

PropTypeDefaultDescription
responseDataArray|ObjectArray or Object value of card data
addSectionTitleTextSection Title property
addCardTitleTextCard Title property
isCustomEditBooleanFalseCustome Edit Functionality

Events

These events are emitted on actions in the datepicker

EventOutputDescription
add-cardThe Card is Added
edit-cardThe Card is Edited
delete-cardThe Card is Deleted

Slots

Slots will help you customize content.

Sometimes you need to add your custom field in card. An example would be to use custom input field :

<template v-slot:cardForm>
  <input type="text" />
</template>
0.3.9

4 months ago

0.3.6

4 months ago

0.3.8

4 months ago

0.3.7

4 months ago

0.3.5

4 months ago

0.3.4

4 months ago

0.3.0

4 months ago

0.2.7

4 months ago

0.2.6

4 months ago

0.2.9

4 months ago

0.2.8

4 months ago

0.3.2

4 months ago

0.3.1

4 months ago

0.2.5

4 months ago

0.3.3

4 months ago

0.2.4

4 months ago

0.2.1

4 months ago

0.2.0

4 months ago

0.1.9

4 months ago

0.2.3

4 months ago

0.2.2

4 months ago

0.1.0

4 months ago

0.1.2

4 months ago

0.1.7

4 months ago

0.1.4

4 months ago

0.1.3

4 months ago

0.1.6

4 months ago

0.0.9

4 months ago

0.0.8

4 months ago

0.1.1

5 months ago