/******************************************************************************* * Copyright(c) 2022 dongke All rights reserved. / Confidential * 类的信息: * 1.程序名称: * 2.功能描述:dkButton组件 * 编辑履历: * 作者 日期 版本 修改内容 * admin 2022-11-17 1.00 新建 *******************************************************************************/ import { button } from '../../../dist/mixins/button'; import { openType } from '../../../dist/mixins/open-type'; Component({ //组件代码共享的特性 behaviors: [button, openType], /** * 组件的属性列表 */ properties: { formType: String,//用于 form 组件,可选值为submit reset,点击分别会触发 form 组件的 submit/reset 事件 icon: String,//左侧图标名称或图片链接,可选值见 Icon 组件 //图标类名前缀,同 Icon 组件的 class-prefix 属性 classPrefix: { type: String, value: 'van-icon', }, plain: Boolean,//是否为朴素按钮 block: Boolean,//是否为块级元素 round: Boolean,//是否为圆形按钮 square: Boolean,//是否为方形按钮 loading: Boolean,//是否显示为加载状态 hairline: Boolean,//是否使用 0.5px 边框 disabled: Boolean,//是否禁用按钮 loadingText: String,//加载状态提示文字 customStyle: String,//自定义样式 //加载状态图标类型,可选值为 spinner loadingType: { type: String, value: 'circular', }, //按钮类型,可选值为 primary info warning danger type: { type: String, value: 'default', }, //按钮 dataset,open-type 为 share 时,可在 onShareAppMessage 事件的 event.target.dataset.detail 中看到传入的值 dataset: null, //按钮尺寸,可选值为 normal large small mini size: { type: String, value: 'normal', }, //加载图标大小 loadingSize: { type: String, value: '20px', }, //按钮颜色,支持传入linear-gradient渐变色 color: String, }, /** * 组件的初始数据 */ data: { text: '' }, /** * 组件的方法列表 */ methods: { // 方法继承opentype ../../dist/mixins/open-type onClick(e){ this.triggerEvent("click",e) } } })