Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-11-18 11:10:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
44c9aa3dcde8330bc2e781cc5f9e9cc203dad8ea
44c9aa3d
1 parent
2a6120ab
✨ feat(邮箱组件): 文字显示调整
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
src/components/EmailField/index.vue
src/components/EmailField/index.vue
View file @
44c9aa3
<!--
* @Date: 2022-08-29 14:31:20
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-
09-16 17:13:01
* @LastEditTime: 2022-
11-18 10:54:23
* @FilePath: /data-table/src/components/EmailField/index.vue
* @Description:
单行文本
输入框
* @Description:
邮箱
输入框
-->
<template>
<div class="text-field-page">
<div class="label">{{ item.component_props.label }}<span v-if="item.component_props.required"> *</span></div>
<van-field v-model="item.value" :name="item.name" type="email" :placeholder="item.component_props.placeholder" :rules="rules"
:required="item.component_props.required" clearable />
<div class="label">
{{ item.component_props.label
}}<span v-if="item.component_props.required"> *</span>
</div>
<van-field
v-model="item.value"
:name="item.name"
type="email"
:placeholder="item.component_props.placeholder"
:rules="rules"
:required="item.component_props.required"
clearable
/>
</div>
</template>
<script setup>
const props = defineProps({
item: Object
item: Object
,
});
const pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
const rules = [{ pattern, message:
'请输入正确内容邮箱' }]
const rules = [{ pattern, message:
"请输入正确邮箱" }];
</script>
<style lang="less" scoped>
.text-field-page {
.text-field-page {
.label {
padding: 1rem 1rem 0 1rem;
font-size: 0.9rem;
...
...
@@ -32,5 +42,5 @@ const rules = [{ pattern, message: '请输入正确内容邮箱' }]
color: red;
}
}
}
}
</style>
...
...
Please
register
or
login
to post a comment