From 14acf92f44efe4986455e833b8d652cd0b021483 Mon Sep 17 00:00:00 2001 From: credred Date: Sun, 16 Jan 2022 21:47:05 +0800 Subject: [PATCH] docs: update README.md --- README.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 91 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f5342b7..3b78780 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,96 @@ -# Vue 3 + Typescript + Vite +# vue-drag-select +A drag select component for Vue3 -This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 ` + + + + + + +``` + +## 📖Ducumentation +### DragSelect Attributes +Attribute | Description | Type | Default +-|-|-|- +modelValue / v-model | binding value | Array \| Set | --(required) +background | background color of drag area, 'none' represent hide this style to avoid override background color of class | string | rgba(66, 153, 225, 0.5 | +draggableOnOption | can draggable when dragstart event target on DragSelectOption | boolean | true +dragAreaClass | the class names of drag area | string | -- +dragAreaStyle | the class styles of drag area | string | -- +selectedOptionClass | the class names of selected DragSelectOption | string | -- +selectedOptionStyle | the selected styles of selected DragSelectOption | string | -- + + +### DragSelect Methods +Method | Description | Parameters +-|-|- +selectAll | select all options | -- +selectOptions | select certain options | Array +deselectOptions | deselect certain options | Array +toggleOptions | toggle select status of certain options | Array +clearSelection | clear current selection | -- +reverseSelection | reverse current selection | -- + +### DragSelectOption Attributes +Attribute | Description | Type | Default +-|-|-|- +value | binding value | string \| index | --(required) +disabled | whether DragSelectOption is disabled | boolean | false +selectedClass | the class names of selected option | boolean | -- + +### Component classNames +this package havn't enough styles,you can use following classNames to add styles. +name | Description +-|- +drag-select__wrapper | the className of DragSelect itself +drag-select | the className of the container of dragSelectOption +drag-select__area | the className of drag area +drag-select__option | the className of dragSelectOption component +drag-select__option--selected | the className of dragSelectOption component which are selected +drag-select__option--disabled | the className of dragSelectOption component which are disabled \ No newline at end of file