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