提交 ee159961 编写于 作者: M mehaotian

build uni-ui 1.2.10

上级 babe1d77
......@@ -81,7 +81,7 @@
background-color: #f1f1f1;
background-color: transparent;
text-align: center;
font-family: "Helvetica Neue", Helvetica, sans-serif;
font-family: 'Helvetica Neue', Helvetica, sans-serif;
font-size: 12px;
padding: 0px 6px;
}
......
......@@ -136,7 +136,7 @@
/* #ifndef APP-NVUE */
.uni-border:after {
content: "";
content: '';
position: absolute;
bottom: 0;
left: 0;
......@@ -165,7 +165,7 @@
/* #ifndef APP-NVUE */
.uni-border-bottom:after {
content: "";
content: '';
position: absolute;
bottom: 0;
left: 0;
......@@ -193,7 +193,7 @@
/* #ifndef APP-NVUE */
.uni-border-top:after {
content: "";
content: '';
position: absolute;
bottom: 0;
left: 0;
......
......@@ -180,7 +180,7 @@
}
.uni-combox__selector::before {
content: "";
content: '';
position: absolute;
width: 0;
height: 0;
......
......@@ -20,58 +20,6 @@ const attrs = [
]
export default {
props: {
options: {
type: [Object, Array],
default () {
return {}
}
},
collection: {
type: String,
default: ''
},
action: {
type: String,
default: ''
},
field: {
type: String,
default: ''
},
pageData: {
type: String,
default: 'add'
},
pageCurrent: {
type: Number,
default: 1
},
pageSize: {
type: Number,
default: 20
},
getcount: {
type: [Boolean, String],
default: false
},
orderby: {
type: String,
default: ''
},
where: {
type: [String, Object],
default: ''
},
getone: {
type: [Boolean, String],
default: false
},
manual: {
type: Boolean,
default: false
}
},
data() {
return {
loading: false,
......
......@@ -8,7 +8,7 @@
<template v-else>
<checkbox-group v-if="multiple" class="checklist-group" :class="{'is-list':mode==='list','is-wrap':wrap}" @change="chagne">
<label class="checklist-box" :class="item.labelClass" :style="[item.styleBackgroud]" v-for="(item,index) in dataList" :key="index">
<checkbox hidden :disabled="!!item.disable" :value="item.value+''" :checked="item.selected" />
<checkbox class="hidden" hidden :disabled="!!item.disabled" :value="item.value+''" :checked="item.selected" />
<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" class="checkbox__inner" :class="item.checkboxBgClass" :style="[item.styleIcon]">
<view class="checkbox__inner-icon" :class="item.checkboxClass"></view>
</view>
......@@ -20,7 +20,7 @@
</checkbox-group>
<radio-group v-else class="checklist-group" :class="{'is-list':mode==='list','is-wrap':wrap}" @change="chagne">
<label class="checklist-box" :class="item.labelClass" :style="[item.styleBackgroud]" v-for="(item,index) in dataList" :key="index">
<radio hidden :disabled="item.disable" :value="item.value+''" :checked="item.selected" />
<radio hidden :disabled="item.disabled" :value="item.value+''" :checked="item.selected" />
<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" class="radio__inner" :class="item.checkboxBgClass" :style="[item.styleBackgroud]">
<view class="radio__inner-icon" :class="item.checkboxClass" :style="[item.styleIcon]"></view>
</view>
......@@ -106,11 +106,63 @@
selectedTextColor: {
type: String,
default: ''
},
// clientDB 相关
options: {
type: [Object, Array],
default () {
return {}
}
},
collection: {
type: String,
default: ''
},
action: {
type: String,
default: ''
},
field: {
type: String,
default: ''
},
pageData: {
type: String,
default: 'add'
},
pageCurrent: {
type: Number,
default: 1
},
pageSize: {
type: Number,
default: 20
},
getcount: {
type: [Boolean, String],
default: false
},
orderby: {
type: String,
default: ''
},
where: {
type: [String, Object],
default: ''
},
getone: {
type: [Boolean, String],
default: false
},
manual: {
type: Boolean,
default: false
}
},
watch: {
localdata: {
handler(newVal) {
this.range = newVal
this.dataList = this.getDataList(this.getSelectedValue(newVal))
},
deep: true
......@@ -119,7 +171,6 @@
listData(newVal) {
this.range = newVal
this.dataList = this.getDataList(this.getSelectedValue(newVal))
// console.log('----listData', this.dataList);
},
value(newVal) {
this.dataList = this.getDataList(newVal)
......@@ -223,7 +274,7 @@
let classes = []
switch (this.mode) {
case 'default':
item.disable && classes.push('disabled-cursor')
item.disabled && classes.push('disabled-cursor')
break
case 'button':
classes.push(...['is-button', ...this.getClasses(item, 'button')])
......@@ -234,7 +285,7 @@
} else {
classes.push('is-list-box')
}
item.disable && classes.push('is-list-disabled')
item.disabled && classes.push('is-list-disabled')
index !== 0 && classes.push('is-list-border')
break
case 'tag':
......@@ -289,6 +340,7 @@
}
}
dataList.forEach((item, index) => {
item.disabled = item.disable || item.disabled || false
if (this.multiple) {
if (value.length > 0) {
let have = value.find(val => val === item.value)
......@@ -317,14 +369,14 @@
if (selectList.length <= min) {
let have = selectList.find(val => val.value === item.value)
if (have !== undefined) {
item.disable = true
item.disabled = true
}
}
if (selectList.length >= max && max !== '') {
let have = selectList.find(val => val.value === item.value)
if (have === undefined) {
item.disable = true
item.disabled = true
}
}
}
......@@ -361,11 +413,11 @@
*/
getClasses(item, name, type = '') {
let classes = []
item.disable && classes.push('is-' + name + '-disabled' + type)
item.disabled && classes.push('is-' + name + '-disabled' + type)
item.selected && classes.push('is-' + name + '-checked' + type)
if (this.mode !== 'button' || name === 'button') {
item.selected && item.disable && classes.push('is-' + name + '-disabled-checked' + type)
item.selected && item.disabled && classes.push('is-' + name + '-disabled-checked' + type)
}
return classes
......@@ -443,6 +495,8 @@
@charset "UTF-8";
.uni-data-checklist {
position: relative;
z-index: 0;
/* min-height: 36px; */
}
......@@ -564,7 +618,7 @@
top: 1px;
width: 3px;
opacity: 0;
transition: transform 0.2s;
transition: transform .2s;
transform-origin: center;
transform: rotate(40deg) scaleY(0.4);
}
......@@ -585,7 +639,7 @@
border-radius: 16px;
background-color: #fff;
z-index: 1;
transition: border-color 0.3s;
transition: border-color .3s;
}
.radio__inner-icon {
......@@ -593,7 +647,7 @@
height: 8px;
border-radius: 10px;
opacity: 0;
transition: transform 0.3s;
transition: transform .3s;
}
.checkobx__list {
......@@ -758,4 +812,10 @@
.is-wrap {
flex-direction: column;
}
.hidden {
/* #ifdef MP-ALIPAY */
display: none;
/* #endif */
}
</style>
\ No newline at end of file
......@@ -304,14 +304,14 @@
}
.uni-datetime-picker-colon::after {
content: ":";
content: ':';
position: absolute;
top: 53px;
right: 0;
}
.uni-datetime-picker-hyphen::after {
content: "-";
content: '-';
position: absolute;
top: 53px;
right: -2px;
......@@ -342,7 +342,7 @@
border-style: solid;
transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
transform-origin: center;
transition: transform 0.3s;
transition: transform .3s;
position: absolute;
top: 50%;
right: 5px;
......
<template>
<view class="uni-easyinput" :class="{'uni-easyinput-error':msg}">
<view class="uni-easyinput__content" :class="{'is-input-border':inputBorder ,'is-input-error-border':inputBorder && msg,'is-textarea':type==='textarea','is-disabled':disabled}">
<uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc"></uni-icons>
<view class="uni-easyinput" :class="{'uni-easyinput-error':msg}" :style="{color:inputBorder && msg?'#dd524d':styles.color}">
<view class="uni-easyinput__content" :class="{'is-input-border':inputBorder ,'is-input-error-border':inputBorder && msg,'is-textarea':type==='textarea','is-disabled':disabled}" :style="{'border-color':inputBorder && msg?'#dd524d':styles.borderColor,'background-color':disabled?styles.disableColor:'#fff'}">
<uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc" @click="onClickIcon('prefix')"></uni-icons>
<textarea v-if="type === 'textarea'" class="uni-easyinput__content-textarea" :class="{'input-padding':inputBorder}" :name="name" :value="val" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" :autoHeight="autoHeight" @input="onInput" @blur="onBlur" @focus="onFocus" @confirm="onConfirm"></textarea>
<input v-else :type="type === 'password'?'text':type" class="uni-easyinput__content-input" :style="{
'padding-right':type === 'password' ||clearable || prefixIcon?'':'10px',
'padding-left':prefixIcon?'':'10px',
'color':msg?'#dd524d':''
'padding-left':prefixIcon?'':'10px'
}" :name="name" :value="val" :password="!showPassword && type === 'password'" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" @focus="onFocus" @blur="onBlur" @input="onInput" @confirm="onConfirm" />
<template v-if="type === 'password'">
<uni-icons v-if="val != '' " class="content-clear-icon" :class="{'is-textarea-icon':type==='textarea'}" :type="showPassword?'eye-slash-filled':'eye-filled'" :size="18" color="#c0c4cc" @click="onEyes"></uni-icons>
</template>
<template v-else-if="suffixIcon">
<uni-icons v-if="suffixIcon" class="content-clear-icon" :type="suffixIcon" color="#c0c4cc"></uni-icons>
<uni-icons v-if="suffixIcon" class="content-clear-icon" :type="suffixIcon" color="#c0c4cc" @click="onClickIcon('suffix')"></uni-icons>
</template>
<template v-else>
<uni-icons class="content-clear-icon" :class="{'is-textarea-icon':type==='textarea'}" type="clear" :size="clearSize" v-if="clearable && focused && val " color="#c0c4cc" @click="onClear"></uni-icons>
......@@ -47,10 +46,12 @@
* @property {String} suffixIcon 输入框尾部图标
* @property {Boolean} trim 是否自动去除两端的空格
* @property {Boolean} inputBorder 是否显示input输入框的边框(默认false)
* @property {Object} styles 自定义颜色
* @event {Function} input 输入框内容发生变化时触发
* @event {Function} focus 输入框获得焦点时触发
* @event {Function} blur 输入框失去焦点时触发
* @event {Function} confirm 点击完成按钮时触发
* @event {Function} iconClick 点击图标时触发
* @example <uni-easyinput v-model="mobile"></uni-easyinput>
*/
......@@ -116,6 +117,17 @@
trim: {
type: Boolean,
default: true
},
// 自定义样式
styles: {
type: Object,
default () {
return {
color: '#333',
disableColor: '#eee',
borderColor: '#e5e5e5'
}
}
}
},
data() {
......@@ -141,6 +153,7 @@
},
watch: {
value(newVal) {
if (this.errMsg) this.errMsg = ''
this.val = newVal
if (this.formItem) {
this.formItem.setValue(newVal)
......@@ -176,6 +189,9 @@
*/
init() {
},
onClickIcon(type) {
this.$emit('iconClick', type)
},
/**
* 获取父元素实例
......
......@@ -18,25 +18,45 @@
<view class="fild-body" :class="[inputBorder ? 'uni-input-border' : '']" :style="[borderEixstTextareaStyle]">
<view class="uni-flex-1 uni-flex" :style="[inputWrapStyle]">
<textarea v-if="type == 'textarea'" class="uni-flex-1 uni-textarea-class" :name="name" :value="value" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled" :maxlength="inputMaxlength" :focus="focus" :autoHeight="autoHeight" @input="onInput" @blur="onBlur" @focus="onFocus" @confirm="onConfirm" @tap="fieldClick" />
<input v-else :type="type" class="uni-flex-1 uni-field__input-wrap" :name="name" :value="value" :password="password || this.type === 'password'" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled" :maxlength="inputMaxlength" :focus="focus" :confirmType="confirmType" @focus="onFocus" @blur="onBlur" @input="onInput" @confirm="onConfirm" @tap="fieldClick" />
<input
v-else
:type="type"
class="uni-flex-1 uni-field__input-wrap"
:name="name"
:value="value"
:password="password || this.type === 'password'"
:placeholder="placeholder"
:placeholderStyle="placeholderStyle"
:disabled="disabled"
:maxlength="inputMaxlength"
:focus="focus"
:confirmType="confirmType"
@focus="onFocus"
@blur="onBlur"
@input="onInput"
@confirm="onConfirm"
@tap="fieldClick"
/>
<uni-icons :size="clearSize" v-if="clearable && value != ''" type="clear" color="#c0c4cc" @click="onClear" class="uni-clear-icon" />
</view>
<view class="uni-button-wrap">
<slot name="right" />
</view>
<view class="uni-button-wrap"><slot name="right" /></view>
<uni-icons v-if="rightIcon" size="16" @click="rightIconClick" :type="rightIcon" color="#c0c4cc" :style="[rightIconStyle]" />
</view>
</view>
<view v-if="errorBottom" class="uni-error-message" :style="{
<view
v-if="errorBottom"
class="uni-error-message"
:style="{
paddingLeft: Number(labelWid) + 4 + 'px'
}">
}"
>
{{ msg }}
</view>
</view>
</template>
<script>
/**
/**
* Field 输入框
* @description 此组件可以实现表单的输入与校验,包括 "text" 和 "textarea" 类型。
* @tutorial https://ext.dcloud.net.cn/plugin?id=21001
......@@ -74,7 +94,7 @@
* @event {Function} click 输入框被点击或者通过right-icon生成的图标被点击时触发,这样设计是考虑到传递右边的图标,一般都为需要弹出"picker"等操作时的场景,点击倒三角图标,理应发出此事件,见上方说明
* @example <uni-field v-model="mobile" label="手机号" required :error-message="errorMessage"></uni-field>
*/
export default {
export default {
name: 'uni-field',
props: {
// rules:{
......@@ -298,7 +318,7 @@
this.formRules = this.form.formRules[this.name];
}
this.validator = this.form.validator;
if (this.name) {
if(this.name){
this.form.formData[this.name] = this.value || '';
}
} else {
......@@ -336,7 +356,8 @@
this.val = this.val === '' ? this.val : Number(this.val);
}
typeof callback === 'function' &&
callback({
callback(
{
[this.name]: this.val
},
this.name
......@@ -449,136 +470,115 @@
}
}
}
};
};
</script>
<style scoped>
@charset "UTF-8";
.uni-field {
<style scoped>@charset "UTF-8";
.uni-field {
padding: 16px 14px;
text-align: left;
color: #333;
font-size: 14px;
background-color: #fff;
}
background-color: #fff; }
.uni-field-inner {
.uni-field-inner {
display: flex;
align-items: center;
}
align-items: center; }
.uni-textarea-inner {
align-items: flex-start;
}
.uni-textarea-inner {
align-items: flex-start; }
.uni-textarea-class {
.uni-textarea-class {
min-height: 48px;
width: auto;
font-size: 14px;
}
font-size: 14px; }
.fild-body {
.fild-body {
width: 100%;
display: flex;
flex: 1;
align-items: center;
}
align-items: center; }
.uni-arror-right {
margin-left: 4px;
}
.uni-arror-right {
margin-left: 4px; }
.uni-label-text {
display: inline-block;
}
.uni-label-text {
display: inline-block; }
.uni-label-left-gap {
margin-left: 3px;
}
.uni-label-left-gap {
margin-left: 3px; }
.uni-label-postion-top {
.uni-label-postion-top {
flex-direction: column;
align-items: flex-start;
flex: 1;
}
flex: 1; }
.uni-field-label {
.uni-field-label {
width: 65px;
flex: 1 1 65px;
text-align: left;
position: relative;
display: flex;
align-items: center;
}
align-items: center; }
.uni-required::before {
content: "*";
.uni-required::before {
content: '*';
position: absolute;
left: -8px;
font-size: 14px;
color: #dd524d;
height: 9px;
line-height: 1;
}
line-height: 1; }
.uni-field__input-wrap {
.uni-field__input-wrap {
position: relative;
overflow: hidden;
font-size: 14px;
height: 24px;
flex: 1;
width: auto;
}
width: auto; }
.uni-clear-icon {
.uni-clear-icon {
display: flex;
align-items: center;
}
align-items: center; }
.uni-error-message {
.uni-error-message {
line-height: 12px;
padding-top: 2px;
padding-bottom: 2px;
color: #dd524d;
font-size: 12px;
text-align: left;
}
.uni-input-error-border {
border-color: #dd524d;
}
.placeholder-style {
color: #969799;
}
.uni-input-class {
font-size: 14px;
}
.uni-button-wrap {
margin-left: 4px;
}
/* start--Retina 屏幕下的 1px 边框--start */
.uni-border,
.uni-border-bottom,
.uni-border-left,
.uni-border-right,
.uni-border-top,
.uni-border-top-bottom {
position: relative;
}
.uni-border-bottom:after,
.uni-border-left:after,
.uni-border-right:after,
.uni-border-top-bottom:after,
.uni-border-top:after,
.uni-border:after {
text-align: left; }
.uni-input-error-border {
border-color: #dd524d; }
.placeholder-style {
color: #969799; }
.uni-input-class {
font-size: 14px; }
.uni-button-wrap {
margin-left: 4px; }
/* start--Retina 屏幕下的 1px 边框--start */
.uni-border,
.uni-border-bottom,
.uni-border-left,
.uni-border-right,
.uni-border-top,
.uni-border-top-bottom {
position: relative; }
.uni-border-bottom:after,
.uni-border-left:after,
.uni-border-right:after,
.uni-border-top-bottom:after,
.uni-border-top:after,
.uni-border:after {
/* #ifndef APP-NVUE */
content: " ";
content: ' ';
/* #endif */
position: absolute;
left: 0;
......@@ -591,76 +591,62 @@
height: 199.7%;
transform: scale(0.5, 0.5);
border: 0 solid #e5e5e5;
z-index: 2;
}
z-index: 2; }
.uni-input-border {
.uni-input-border {
min-height: 34px;
padding-left: 4px;
border: 1px solid #e5e5e5;
border-radius: 6px;
box-sizing: border-box;
}
box-sizing: border-box; }
.uni-border-top:after {
border-top-width: 1px;
}
.uni-border-top:after {
border-top-width: 1px; }
.uni-border-left:after {
border-left-width: 1px;
}
.uni-border-left:after {
border-left-width: 1px; }
.uni-border-right:after {
border-right-width: 1px;
}
.uni-border-right:after {
border-right-width: 1px; }
.uni-border-bottom:after {
border-bottom-width: 1px;
}
.uni-border-bottom:after {
border-bottom-width: 1px; }
.uni-border-top-bottom:after {
border-width: 1px 0;
}
.uni-border-top-bottom:after {
border-width: 1px 0; }
.uni-border:after {
border-width: 1px;
}
.uni-border:after {
border-width: 1px; }
/* end--Retina 屏幕下的 1px 边框--end */
.uni-icon-wrap {
/* end--Retina 屏幕下的 1px 边框--end */
.uni-icon-wrap {
padding-left: 3px;
padding-right: 3px;
display: flex;
align-items: center;
justify-content: center;
}
justify-content: center; }
.uni-button-wrap {
.uni-button-wrap {
display: flex;
align-items: right;
justify-content: center;
}
justify-content: center; }
.uni-clear-icon {
.uni-clear-icon {
display: flex;
align-items: center;
margin-left: 4px;
}
margin-left: 4px; }
.uni-flex {
.uni-flex {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
}
align-items: center; }
.uni-flex-1 {
flex: 1;
}
.uni-flex-1 {
flex: 1; }
.uni-error-in-label {
.uni-error-in-label {
display: flex;
flex-direction: row;
}
flex-direction: row; }
</style>
\ No newline at end of file
......@@ -179,7 +179,6 @@
this.labelPos = this.labelPosition ? this.labelPosition : labelPosition
this.labelWid = this.label ? (this.labelWidth ? this.labelWidth : labelWidth) : 0
this.labelAli = this.labelAlign ? this.labelAlign : labelAlign
console.log(this.labelWid);
// 判断第一个 item
if (!this.form.isFirstBorder) {
this.form.isFirstBorder = true
......
......@@ -8,7 +8,7 @@
<scroll-view :scroll-into-view="scrollViewId" class="uni-indexed-list__scroll" scroll-y>
<view v-for="(list, idx) in lists" :key="idx" :id="'uni-indexed-list-' + idx">
<!-- #endif -->
<uni-indexed-list-item :list="list" :loaded="loaded" :idx="idx" :showSelect="showSelect" @itemClick="onClick"></uni-indexed-list-item>
<indexed-list-item :list="list" :loaded="loaded" :idx="idx" :showSelect="showSelect" @itemClick="onClick"></indexed-list-item>
<!-- #ifndef APP-NVUE -->
</view>
</scroll-view>
......@@ -29,7 +29,7 @@
</template>
<script>
import uniIcons from '../uni-icons/uni-icons.vue'
import uniIndexedListItem from './uni-indexed-list-item.vue'
import indexedListItem from './uni-indexed-list-item.vue'
// #ifdef APP-NVUE
const dom = weex.requireModule('dom');
// #endif
......@@ -85,7 +85,7 @@
name: 'UniIndexedList',
components: {
uniIcons,
uniIndexedListItem
indexedListItem
},
props: {
options: {
......
......@@ -92,7 +92,7 @@
right: 0;
left: 0;
height: 1px;
content: "";
content: '';
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: #e5e5e5;
......
......@@ -244,7 +244,7 @@
right: 0;
left: 0;
height: 1px;
content: "";
content: '';
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: #e5e5e5;
......
......@@ -294,7 +294,7 @@
right: 0;
left: 0;
height: 1px;
content: "";
content: '';
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: #e5e5e5;
......
......@@ -248,7 +248,7 @@
/* .transition {
transition: all 0.3s;
} */
} */
.movable-view-box {
flex-shrink: 0;
height: 100%;
......
......@@ -117,7 +117,7 @@
<style scoped>
/* .uni-title {
} */
} */
.uni-title__box {
/* #ifndef APP-NVUE */
display: flex;
......
......@@ -77,7 +77,7 @@
<style scoped>
.uni-table-tr {
display: table-row;
transition: all 0.3s;
transition: all .3s;
box-sizing: border-box;
}
......
......@@ -5,17 +5,21 @@
<view class="example">
<uni-easyinput v-model="value" focus placeholder="请输入内容" @input="input"></uni-easyinput>
</view>
<uni-section title="自定义样式" type="line"></uni-section>
<view class="example">
<uni-easyinput v-model="value" :styles="styles" :placeholderStyle="placeholderStyle" focus placeholder="请输入内容" @input="input"></uni-easyinput>
</view>
<uni-section title="左图标" type="line"></uni-section>
<view class="example">
<uni-easyinput prefixIcon="search" v-model="value" placeholder="请输入内容"></uni-easyinput>
<uni-easyinput prefixIcon="search" v-model="value" placeholder="请输入内容" @iconClick="iconClick"></uni-easyinput>
</view>
<uni-section title="右图标" type="line"></uni-section>
<view class="example">
<uni-easyinput suffixIcon="search" v-model="value" placeholder="请输入内容"></uni-easyinput>
<uni-easyinput suffixIcon="search" v-model="value" placeholder="请输入内容" @iconClick="iconClick"></uni-easyinput>
</view>
<uni-section title="禁用" type="line"></uni-section>
<view class="example">
<uni-easyinput disabled v-model="value" placeholder="请输入内容"></uni-easyinput>
<uni-easyinput disabled value="已禁用" placeholder="请输入内容"></uni-easyinput>
</view>
<uni-section title="密码框" type="line"></uni-section>
<view class="example">
......@@ -39,7 +43,12 @@
data() {
return {
value: '',
password: ''
password: '',
placeholderStyle: "color:#499721;font-size:16px",
styles: {
color: 'blue',
borderColor: '#499721'
}
}
},
......@@ -48,6 +57,12 @@
methods: {
input(e) {
console.log('输入内容:', e);
},
iconClick(type) {
uni.showToast({
title: `点击了${type==='prefix'?'左侧':'右侧'}的图标`,
icon: 'none'
})
}
}
}
......
<template>
<view>
<text class="example-info"> uni-forms 组件一般由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据。</text>
<uni-forms :value="formData" ref="form" validate-trigger="bind" err-show-type="undertext">
<uni-forms :value="formData" ref="form" validate-trigger="bind" err-show-type="toast">
<uni-group title="基本信息" top="0">
<uni-forms-item name="name" required label="用户名">
<uni-easyinput type="text" :inputBorder="true" v-model="formData.name" placeholder="请输入用户名"></uni-easyinput>
......@@ -16,9 +16,9 @@
<uni-forms-item name="email" label="邮箱">
<uni-easyinput type="text" v-model="formData.email" placeholder="请输入邮箱"></uni-easyinput>
</uni-forms-item>
<!-- <uni-forms-item name="time" label="创建时间">
<uni-forms-item name="time" label="创建时间">
<uni-datetime-picker v-model="formData.time" :min-year="2000" :max-year="2030" :timestamp="true" @change="datetimeChange"></uni-datetime-picker>
</uni-forms-item> -->
</uni-forms-item>
<uni-forms-item name="checked" label="详细信息">
<switch :checked="formData.checked" @change="change('checked',$event.detail.value)" />
</uni-forms-item>
......@@ -185,9 +185,6 @@
this.$refs.form.setRules(this.rules)
},
methods: {
test(e) {
console.log('---', e.detail.value);
},
change(name, value) {
this.formData.checked = value
this.$refs.form.setValue(name, value)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册