fix bug#3949 限制群名称字符长度
This commit is contained in:
parent
e6075849fe
commit
4abd2d8047
@ -29,8 +29,11 @@
|
|||||||
:placeholder="$t('edit.groupName.placeholder')"
|
:placeholder="$t('edit.groupName.placeholder')"
|
||||||
placeholder-style="color:#B4B4B4;font-size:28rpx;font-weight:500;line-height:40rpx;"
|
placeholder-style="color:#B4B4B4;font-size:28rpx;font-weight:500;line-height:40rpx;"
|
||||||
v-model="state.groupName"
|
v-model="state.groupName"
|
||||||
|
@input="handleGroupNameInput"
|
||||||
|
maxlength="20"
|
||||||
/>
|
/>
|
||||||
<img
|
<img
|
||||||
|
v-if="state.groupName"
|
||||||
class="groupName-input-clearBtn"
|
class="groupName-input-clearBtn"
|
||||||
src="/src/static/image/chatSettings/clear-btn.png"
|
src="/src/static/image/chatSettings/clear-btn.png"
|
||||||
@click="clearGroupNameInput"
|
@click="clearGroupNameInput"
|
||||||
@ -82,7 +85,12 @@ onLoad((options) => {
|
|||||||
const clearGroupNameInput = () => {
|
const clearGroupNameInput = () => {
|
||||||
state.groupName = ''
|
state.groupName = ''
|
||||||
}
|
}
|
||||||
|
const handleGroupNameInput = (e) => {
|
||||||
|
if (state.groupName.length > 20) {
|
||||||
|
// 截取前20个字符
|
||||||
|
state.groupName = state.groupName.slice(0, 20)
|
||||||
|
}
|
||||||
|
}
|
||||||
//点击确认修改
|
//点击确认修改
|
||||||
const confirmEdit = () => {
|
const confirmEdit = () => {
|
||||||
console.log(state.groupName)
|
console.log(state.groupName)
|
||||||
@ -146,7 +154,7 @@ const confirmEdit = () => {
|
|||||||
height: 110rpx;
|
height: 110rpx;
|
||||||
box-shadow: 0 6px 12px 2px rgba(188, 188, 188, 0.08);
|
box-shadow: 0 6px 12px 2px rgba(188, 188, 188, 0.08);
|
||||||
padding: 0 74rpx 0 32rpx;
|
padding: 0 74rpx 0 32rpx;
|
||||||
color: #B747474;
|
color: #747474;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
|
Loading…
Reference in New Issue
Block a user