2018-03-26 16:04:04 +08:00
|
|
|
<template>
|
|
|
|
<div class="md-field">
|
|
|
|
<div
|
|
|
|
class="md-field-title"
|
|
|
|
v-if="title !== ''">{{title}}</div>
|
|
|
|
<div class="md-field-content">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
export default {
|
|
|
|
name: 'md-field',
|
|
|
|
|
|
|
|
props: {
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus">
|
|
|
|
.md-field
|
|
|
|
background-color field-item-bg-color
|
|
|
|
.md-field-title
|
|
|
|
display flex
|
|
|
|
font-size field-title-font-size
|
2018-06-05 18:34:40 +08:00
|
|
|
font-weight field-title-font-weight
|
2018-03-26 16:04:04 +08:00
|
|
|
color field-title-color
|
|
|
|
line-height 45px
|
2018-06-29 18:52:26 +08:00
|
|
|
padding field-padding-v field-padding-h field-title-margin field-padding-h
|
2018-03-26 16:04:04 +08:00
|
|
|
.md-field-content
|
|
|
|
display flex
|
|
|
|
flex-direction column
|
2018-07-01 02:02:27 +08:00
|
|
|
.md-field-item,
|
|
|
|
.md-input-item,
|
|
|
|
.md-input-item.is-title-latent .md-input-item-msg,
|
|
|
|
.md-radio
|
2018-06-29 18:52:26 +08:00
|
|
|
padding-left field-padding-h
|
|
|
|
padding-right field-padding-h
|
2018-03-26 16:04:04 +08:00
|
|
|
box-sizing border-box
|
2018-06-29 18:52:26 +08:00
|
|
|
.md-field-item .md-field-item-inner, .md-input-item-container
|
2018-03-26 16:04:04 +08:00
|
|
|
hairline(bottom, field-item-border-color)
|
2018-06-29 18:52:26 +08:00
|
|
|
.md-field-item:last-of-type
|
|
|
|
.md-field-item-inner::before
|
|
|
|
display none
|
2018-06-25 18:39:53 +08:00
|
|
|
// .md-input-item:last-of-type .md-input-item-container::before
|
|
|
|
// display none
|
2018-03-26 16:04:04 +08:00
|
|
|
.md-input-item.error .md-input-item-container
|
2018-06-05 18:34:40 +08:00
|
|
|
hairline(bottom, input-item-color-error)
|
2018-03-26 16:04:04 +08:00
|
|
|
.md-radio .md-radio-item
|
|
|
|
padding-left 0 !important
|
|
|
|
padding-right 0 !important
|
|
|
|
|
|
|
|
</style>
|