|
@@ -1,10 +1,14 @@
|
|
|
-import { Col, Field, Row } from "vant";
|
|
|
+import { Button, Col, Row } from "vant";
|
|
|
import { defineComponent } from "vue";
|
|
|
import styles from './index.module.less';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'input',
|
|
|
props: {
|
|
|
+ required: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
title: {
|
|
|
type: String,
|
|
|
required: true
|
|
@@ -18,7 +22,10 @@ export default defineComponent({
|
|
|
return (
|
|
|
<Row class={styles['col-field']}>
|
|
|
<Col span={24} class={styles.formTitle}>
|
|
|
- {this.title}
|
|
|
+ <div class={styles['col-left']}>{this.required ? <i>*</i> : null}{this.title}</div>
|
|
|
+ <div class={styles['col-right']}>
|
|
|
+ {this.$slots.titleRight && this.$slots.titleRight()}
|
|
|
+ </div>
|
|
|
</Col>
|
|
|
<Col span={24} class={this.border ? 'van-hairline--bottom' : null}>
|
|
|
{this.$slots.default && this.$slots.default()}
|