feat: envinput revalidates with environment changes
This commit is contained in:
@@ -26,7 +26,11 @@ import IntervalTree from "node-interval-tree"
|
|||||||
import debounce from "lodash/debounce"
|
import debounce from "lodash/debounce"
|
||||||
import isUndefined from "lodash/isUndefined"
|
import isUndefined from "lodash/isUndefined"
|
||||||
import { tippy } from "vue-tippy"
|
import { tippy } from "vue-tippy"
|
||||||
import { getCurrentEnvironment } from "~/newstore/environments"
|
import {
|
||||||
|
currentEnvironment$,
|
||||||
|
getCurrentEnvironment,
|
||||||
|
} from "~/newstore/environments"
|
||||||
|
import { useReadonlyStream } from "~/helpers/utils/composables"
|
||||||
|
|
||||||
const tagsToReplace = {
|
const tagsToReplace = {
|
||||||
"&": "&",
|
"&": "&",
|
||||||
@@ -49,7 +53,16 @@ export default defineComponent({
|
|||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
setup() {
|
||||||
|
const currentEnvironment = useReadonlyStream(
|
||||||
|
currentEnvironment$,
|
||||||
|
getCurrentEnvironment()
|
||||||
|
)
|
||||||
|
|
||||||
|
return {
|
||||||
|
currentEnvironment,
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
internalValue: "",
|
internalValue: "",
|
||||||
@@ -70,6 +83,9 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
|
currentEnvironment() {
|
||||||
|
this.processHighlights()
|
||||||
|
},
|
||||||
highlightStyle() {
|
highlightStyle() {
|
||||||
this.processHighlights()
|
this.processHighlights()
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user