Skip to content

Commit

Permalink
the app name cannot start with a digit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjj1024 committed Dec 16, 2024
1 parent 2ffba5a commit b044605
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lang/en_us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default {
urlInvalid: 'The url must start with http',
example: 'example',
appName: 'AppName',
appNameInvalid: 'The app name cannot start with a digit',
appId: 'Identifier',
appIdInvalid: 'The appid must be alphanumeric and dot',
appIcon: 'AppIcon',
Expand Down
1 change: 1 addition & 0 deletions src/lang/ja_jp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default {
urlInvalid: 'urlはhttpで始まる必要があります',
example: '例',
appName: 'アプリ名',
appNameInvalid: 'アプリ名は数字で始めることはできません',
appId: 'アプリID',
appIdInvalid: 'アプリIDは英数字と.で構成されている必要があります',
appIcon: 'アプリアイコン',
Expand Down
1 change: 1 addition & 0 deletions src/lang/ko_kr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default {
urlInvalid: 'url은 http로 시작해야 합니다',
example: '예',
appName: '앱 이름',
appNameInvalid: '앱 이름은 숫자로 시작할 수 없습니다',
appId: '앱 ID',
appIdInvalid: '앱 ID는 영어 숫자와 .로 구성되어야 합니다',
appIcon: '앱 아이콘',
Expand Down
1 change: 1 addition & 0 deletions src/lang/zh_cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default {
urlInvalid: 'url必须以http开头',
example: '例如',
appName: 'APP名称',
appNameInvalid: 'app名称不能以数字开头',
appId: 'APP标识',
appIdInvalid: 'appid必须为字母、数字和.组成',
appIcon: 'APP图标',
Expand Down
1 change: 1 addition & 0 deletions src/lang/zh_tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default {
urlInvalid: 'url必須以http開頭',
example: '例如',
appName: 'APP名稱',
appNameInvalid: 'APP名稱不能以數字開頭',
appId: 'APP標識',
appIdInvalid: 'appid必須為字母、數字和.組成',
appIcon: 'APP圖標',
Expand Down
12 changes: 12 additions & 0 deletions src/pages/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,18 @@ const appRules = reactive<FormRules>({
message: t('inputAppNamePlaceholder'),
trigger: 'blur',
},
{
validator: (rule, value, callback) => {
console.log('appshow name value', value)
// the name cannot start with a digit
if (/^[0-9]/.test(value)) {
callback(new Error(t('appNameInvalid')))
} else {
callback()
}
},
trigger: 'blur',
},
],
appid: [
{
Expand Down

0 comments on commit b044605

Please sign in to comment.