vue复选框组件_Vue的轻量级材料设计复选框组件

Vue材料设计复选框组件是一款适用于Vue的轻量级组件,遵循Material Design规范。文章介绍了如何通过npm安装和在应用中使用该组件,以及组件的属性表,包括自动生成的ID和自定义标签及背景颜色的功能。同时还列出了待完成的任务,如实现涟漪效果。
摘要由CSDN通过智能技术生成

vue复选框组件

Vue材料复选框 (Vue material checkbox)

Material design checkbox component for Vue.

Vue的材料设计复选框组件。

(Use)

与npm (With npm)

  • install plugin

    安装插件

npm install vue-material-checkbox --save
  • import to the app and add to the Vue

    导入到应用程序并添加到Vue

import checkbox from 'vue-material-checkbox'
Vue.use(checkbox)
  • Use it as component:

    用作组件:

<checkbox id="mycheck1" v-model="someVar">My Checkbox</checkbox>

零件 (Component)

There is autogenerated id for label and checkbox, but you can specify it yourself.

标签和复选框有自动生成的ID,但您可以自己指定。

You can specify label for checkbox inside checkbox tag:

您可以在复选框标签内为复选框指定标签:

<checkbox id="mycheck1" v-model="someVar"> ThisIsLabel </checkbox>

You can set custom color for background of checkbox:

您可以为复选框的背景设置自定义颜色:

<checkbox id="mycheck1" v-model="someVar" color="#f50057"> ThisIsLabel </checkbox>

道具完整表 (Complete props table)

PropTypeDefaultWhat For
idStringundefinedRecommended. input id associated with label
valueStringundefinedValue for input, without it checkbox works as true/false
colorStringundefinedPass the color string to change bg-color of checkbox
checkedBooleanfalseis checked by default?
nameStringundefinedName for input
requiredBooleanfalseHTML required attr
disabledBooleanfalseHTML disabled attr
Struts 类型 默认 做什么的
id String undefined 推荐 。 与标签关联的输入ID
value String undefined 输入值(不带输入)复选框为true/false
color String undefined 传递颜色字符串以更改复选框的bg-color
checked Boolean false 默认情况下被选中?
name String undefined 输入名称
required Boolean false HTML必需的属性
disabled Boolean false 禁用HTML的attr

去做 (todo)

  • ripple effect

    连锁React

翻译自: https://vuejsexamples.com/lightweight-material-design-checkbox-component-for-vue/

vue复选框组件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值