feat: auto increment headers and parameters list on input
This commit is contained in:
@@ -168,6 +168,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
commonHeaders,
|
||||
headers$: [],
|
||||
}
|
||||
},
|
||||
subscriptions() {
|
||||
@@ -178,18 +179,20 @@ export default {
|
||||
),
|
||||
}
|
||||
},
|
||||
// watch: {
|
||||
// headers: {
|
||||
// handler(newValue) {
|
||||
// if (
|
||||
// newValue[newValue.length - 1]?.key !== "" ||
|
||||
// newValue[newValue.length - 1]?.value !== ""
|
||||
// )
|
||||
// this.addRequestHeader()
|
||||
// },
|
||||
// deep: true,
|
||||
// },
|
||||
// },
|
||||
watch: {
|
||||
headers$: {
|
||||
handler(newValue) {
|
||||
console.log("changed")
|
||||
if (
|
||||
(newValue[newValue.length - 1]?.key !== "" ||
|
||||
newValue[newValue.length - 1]?.value !== "") &&
|
||||
newValue.length
|
||||
)
|
||||
this.addHeader()
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (!this.headers$?.length) {
|
||||
this.addHeader()
|
||||
|
||||
@@ -197,18 +197,19 @@ export default {
|
||||
),
|
||||
}
|
||||
},
|
||||
// watch: {
|
||||
// params$: {
|
||||
// handler(newValue) {
|
||||
// if (
|
||||
// newValue[newValue.length - 1]?.key !== "" ||
|
||||
// newValue[newValue.length - 1]?.value !== ""
|
||||
// )
|
||||
// this.addParam()
|
||||
// },
|
||||
// deep: true,
|
||||
// },
|
||||
// },
|
||||
watch: {
|
||||
params$: {
|
||||
handler(newValue) {
|
||||
if (
|
||||
(newValue[newValue.length - 1]?.key !== "" ||
|
||||
newValue[newValue.length - 1]?.value !== "") &&
|
||||
newValue.length
|
||||
)
|
||||
this.addParam()
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (!this.params$?.length) {
|
||||
this.addParam()
|
||||
|
||||
Reference in New Issue
Block a user