• Stars
    star
    236
  • Rank 170,480 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SelectPage for Vue2, list or table view of pagination, use tags for multiple selection, i18n and server side resources supports
SelectPage

v-selectpage

circle ci code coverage npm version

SelectPage for Vue, a select items components provides the list of items with pagination

Financial Contributors on Open Collective JavaScript Style Guide npm download license









Examples and Documentation

Live Examples on CodePen, more examples and documentation please visit below sites

The jQuery version: SelectPage

Features

  • Display contents with pagination
  • I18n support
  • Select single / multiple options
  • Tags form for multiple selection
  • Keyboard navigation
  • Searchable
  • Provide display forms such as list view and table view
  • Customization of row / cell content rendering
  • Core module that can be used independently

I18n support languages

  • Chinese Simplified
  • English
  • Japanese
  • Arabic
  • Spanish
  • German
  • Romanian
  • French
  • Portuguese-Brazil
  • Polish
  • Dutch
  • Chinese Traditional
  • Russian
  • Turkish

Installation

https://nodei.co/npm/v-selectpage.png?downloads=true&downloadRank=true&stars=true

Install v-selectpage to your project

# npm
npm i v-selectpage
# yarn
yarn add v-selectpage
# pnpm
pnpm add v-selectpage

Usage

Quick start example

<template>
  <SelectPageList
    key-prop="id"
    label-prop="name"
    @fetch-data="fetchData"
  />
</template>

<script setup>
import { SelectPageList } from 'v-selectpage'

function fetchData (data, callback) {
  // pagination information and search keyword
  const { search, pageNumber, pageSize } = data

  // request parameters
  const parameters = {
    search,
    pageNumber,
    pageSize,
    ...
  }

  // fetch data list with pagination state
  doDataRequest(parameters)
    .then(resp => {
      /**
       * Return data format for example
       * {
       *   list: object[], // current page data list
       *   total: number // result count
       * }
       */
      callback(resp.list, resp.total)
    })
    .catch(() => {
      // clear the data list if necessary when request fails
      callback([], 0)
    })
}
</script>

Set default selected items

<template>
  <SelectPageList
    language="zh-chs"
    v-model="selected"
    :multiple="true"
    @fetch-data="fetchData"
    @fetch-selected-data="fetchSelectedData"
  />
</template>

<script setup>
import { ref } from 'vue'
import { SelectPageList } from 'v-selectpage'

const selected = ref([2, 4, 7])

// fetch current page data
function fetchData (data, callback) {
  ...
}
// fetch selected items data
function fetchSelectedData (keys, callback) {
  // get data models by keys
  doDataRequest({ keys }).then(resp => {
    callback(resp)
  })
}
</script>

Plugin preview

List view for Single selection

single

List view for multiple selection with tags form

multiple

Table view for single selection

table

Dependencies

More Repositories

1

v-region

提供 5 种应用形式的 4 级行政区划选择器 A simple region cascade selector, provide 4 levels Chinese administrative division data
JavaScript
866
star
2

SelectPage

A simple style and powerful selector, including ajax remote data, autocomplete, pagination, tags, i18n and keyboard navigation features
JavaScript
731
star
3

SelectMenu

Simple, easily and diversity menu solution
JavaScript
297
star
4

v-uploader

A Vue2 plugin make files upload simple and easier, single file upload with image preview, multiple upload with drag and drop
Vue
238
star
5

v-selectmenu

SelectMenu for Vuejs, A simple, easier and highly customized menu solution
JavaScript
187
star
6

bDialog

Extend the Bootstrap Modal features, making dialog more functions and easier to use, dialog type including modal, alert, mask and toast types
JavaScript
175
star
7

v-dialogs

A simple and clean instructional dialog plugin for Vue2, dialog type including Modal, Alert, Mask and Toast
JavaScript
128
star
8

bTabs

A jQuery plugin open pages in tab, based on Bootstrap2,3
JavaScript
127
star
9

frontend-develops-skill-summary

Development experience with javascript, jQuery, Vuejs, Wechat MiniProgram and so on
122
star
10

bPage

Based on bootstrap style, static page jump can also be asynchronous page processing pagination plugin
JavaScript
102
star
11

v-page

A simple and useful pagination component for vue2 and vue3
JavaScript
90
star
12

v-suggest

A Vue2 plugin for input content suggestions, support using keyboard to navigate and quick pick, it make use experience like search engine input element
JavaScript
75
star
13

v-gallery

A Vue2 plugin for images show in gallery or carousel
Vue
62
star
14

vuepress-login

Add user authorization for VuePress
JavaScript
41
star
15

v-ztree

A simple tree for Vue2, support single or multiple(check) select tree, and support server side data
Vue
36
star
16

v-playback

A Vue2 plugin to make video play easier
Vue
18
star
17

v-dropdown

A dropdown container layer plugin for vue
JavaScript
15
star
18

vue-plugins

vue plugins development environment
JavaScript
11
star
19

v-tablegrid

A simpler to use and practical datatable
Vue
9
star
20

TerryZ.github.io

Main Page
HTML
5
star
21

grid-improve

grid-improve
HTML
1
star