修复过滤器切换模式不生效的bug

This commit is contained in:
Peng-YM
2020-09-01 08:43:30 +08:00
parent 37512eaa00
commit 8e3afe82d3
6 changed files with 160 additions and 102 deletions

View File

@@ -83,6 +83,15 @@ export default {
},
remove(idx) {
this.keywords.splice(idx, 1);
},
save() {
this.$emit("dataChanged", {
idx: this.idx,
args: {
keywords: this.keywords,
keep: this.mode === 'IN'
}
});
}
},
created() {
@@ -93,17 +102,13 @@ export default {
}
},
watch: {
mode() {
this.save();
},
keywords() {
this.$emit("dataChanged", {
idx: this.idx,
type: "Keyword Filter",
args: {
keywords: this.keywords,
keep: this.mode === 'IN'
}
})
this.save();
}
}
},
}
</script>

View File

@@ -87,18 +87,23 @@ export default {
},
remove(idx) {
this.regexps.splice(idx, 1);
}
},
watch: {
regexps() {
},
save() {
this.$emit("dataChanged", {
idx: this.idx,
type: "Regex Filter",
args: {
regex: this.regexps,
keep: this.mode === 'IN'
}
})
});
}
},
watch: {
regexps() {
this.save();
},
mode() {
this.save();
}
},
created() {

View File

@@ -1,3 +1,3 @@
const DEBUG = false;
const DEBUG = true;
export const BACKEND_BASE = DEBUG ? `http://192.168.1.134:3000` : `https://sub.store`;

View File

@@ -274,6 +274,7 @@ export default {
},
dataChanged(content) {
console.log(`${JSON.stringify(content)}`);
this.options.process[content.idx].args = content.args;
},