add constant

This commit is contained in:
Jesse-Ma
2022-12-09 14:14:27 +08:00
parent a0d58cf0a5
commit 5a9fe66cad
10 changed files with 38 additions and 116 deletions

View File

@@ -203,6 +203,7 @@ import storage from "@/libs/storage";
import { setStoreText } from "@/libs/noteStorage";
import { saveAs } from 'file-saver';
import { isWeixin } from "@/libs/utils";
import NoteConstant from "@/libs/constants";
export default {
name: 'EditNote',
@@ -343,8 +344,8 @@ export default {
},
recordText() {
let text = this.noteForm.text;
if (text.length > 409600) {
this.errorInfo = this.$t('error.100012');
if (text.length > NoteConstant.noteMaxCount) {
this.errorInfo = this.$t('error.100012',[NoteConstant.noteMaxDesc]);
this.model.showError = true;
return;
}
@@ -372,8 +373,8 @@ export default {
let end = event.currentTarget.selectionEnd;
let text = event.currentTarget.value;
if (text.length > 409600) {
this.errorInfo = this.$t('error.100012');
if (text.length > NoteConstant.noteMaxCount) {
this.errorInfo = this.$t('error.100012',[NoteConstant.noteMaxDesc]);
this.model.showError = true;
return;
}
@@ -418,8 +419,8 @@ export default {
},
validateForm() {
let text = this.noteForm.text;
if (text.length > 409600) {
this.errorInfo = this.$t('error.100012');
if (text.length > NoteConstant.noteMaxCount) {
this.errorInfo = this.$t('error.100012',[NoteConstant.noteMaxDesc]);
this.model.showError = true;
return false;
}