File tree Expand file tree Collapse file tree 1 file changed +27
-3
lines changed
admin/src/views/index/navi Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Original file line number Diff line number Diff line change 1818 ></el-input >
1919 </el-form-item >
2020 <el-form-item label =" 导航URL" prop =" url" >
21- <el-input v-model =" form.url" placeholder =" 请输入导航URL" ></el-input >
21+ <el-input
22+ v-model.trim =" form.url"
23+ placeholder =" 请输入导航URL"
24+ ></el-input >
2225 </el-form-item >
2326 <el-form-item label =" 新标签打开" prop =" newtab" >
2427 <el-switch v-model =" form.newtab" />
5255 </el-form-item >
5356 <el-form-item label =" 页面参数" prop =" query" >
5457 <el-input
55- v-model =" form.query"
56- type =" textarea"
58+ v-model.trim =" form.query"
5759 placeholder =" 请输入页面参数如:?id=1&name=2"
5860 ></el-input >
5961 </el-form-item >
@@ -88,6 +90,28 @@ export default {
8890 naviname: [
8991 { required: true , message: ' 请输入导航名称' , trigger: ' blur' },
9092 ],
93+ url: [
94+ {
95+ validator : (rule , value , callback ) => {
96+ if (value) {
97+ const queryParamMatch = value .match (/ (\? . + )$ / )
98+ if (queryParamMatch) {
99+ const queryPart = queryParamMatch[1 ]
100+ callback (
101+ new Error (
102+ ` URL中包含了查询参数"${ queryPart} ",请将这部分内容填写到下方的"页面参数"一栏`
103+ )
104+ )
105+ } else {
106+ callback ()
107+ }
108+ } else {
109+ callback ()
110+ }
111+ },
112+ trigger: ' blur' ,
113+ },
114+ ],
91115 })
92116 const formRef = ref (null )
93117 const submit = () => {
You can’t perform that action at this time.
0 commit comments