Vue的Cool Flexible Select组件

Vue的Cool Flexible Select组件

插件名称:vue-cool-select

发布时间:2020年6月9日

插件作者:iliyaZelenko

官网 演示 GitHub下载

选择具有自动完成,插槽,引导程序和材料设计主题的主题。

变更日志:

v3.5.2(07/31/2020)

  • Bug修复

特征:

  • 2个主题:Bootstrap 4,材料设计
  • 自动完成
  • 异步数据
  • 插槽
  • 加载指示器
  • 验证
  • 在移动设备上的支持
  • 禁用且只读
  • 通过箭头控制
  • 许多道具和活动

安装和下载:

# Yarn
$ yarn add vue-cool-select

# NPM
$ npm install vue-cool-select --save

使用:

NPM

导入此插件css(主题),然后通过添加插件Vue.use

import { CoolSelectPlugin } from 'vue-cool-select'

// 粘贴线以下只有当你需要“bootstrap”的主题
import 'vue-cool-select/dist/themes/bootstrap.css'
// 粘贴下面只有在订单您需要“material-design”主题
import 'vue-cool-select/dist/themes/material-design.css'
// 您也可以导入主题

Vue.use(CoolSelectPlugin)

在另一个组件内使用:

import { CoolSelect } from 'vue-cool-select'

export default {
  components: { CoolSelect },
  data () {
    return {
      // 简单的例子
      items: ['Item 1', 'Item 2', 'Item 3'],
      // 将有一个选定的项目
      selected: null
    }
  }
}

添加到<template>

<cool-select
  v-model="selected"
  :items="items"
/>

浏览器(CDN)

在页面中包括vue-cool-select。

<script src="https://unpkg.com/vue-cool-select"></script>

<!-- paste the line below only if you need "bootstrap" theme -->
<link rel="stylesheet" href="https://unpkg.com/vue-cool-select/dist/themes/bootstrap.css">
<!-- paste the line below only if you need "material-design" theme -->
<link rel="stylesheet" href="https://unpkg.com/vue-cool-select/dist/themes/material-design.css">

如果在页面中检测到Vue,则插件将自动安装。

相关插件