We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a089417 commit bbd6862Copy full SHA for bbd6862
1 file changed
packages/plugins/resource/src/ResourceList.vue
@@ -249,13 +249,14 @@ export default {
249
validator: ({ row }, value) => {
250
const { type } = row
251
return new Promise((resolve, reject) => {
252
- if (type === 'url' && !value) {
253
- reject(new Error('资源URL必填'))
254
- } else if (!/^(http|https):\/\/[^\s]+(\.png|\.jpg|\.jpeg|\.svg)$/.test(value)) {
255
- reject(new Error('URL须以http或https开头,以文件后缀名结尾'))
256
- } else {
257
- resolve()
+ if (type === 'url') {
+ if (!value) {
+ reject(new Error('资源URL必填'))
+ } else if (!/^(http|https):\/\/[^\s]+(\.png|\.jpg|\.jpeg|\.svg)$/.test(value)) {
+ reject(new Error('URL须以http或https开头,以文件后缀名结尾'))
+ }
258
}
259
+ resolve()
260
})
261
262
0 commit comments