弃用lodash

This commit is contained in:
fofolee
2024-12-30 20:41:54 +08:00
parent 7a79d3a443
commit 1d3aa3c9ae
30 changed files with 597 additions and 152 deletions

View File

@@ -437,7 +437,7 @@ export default {
if (this.currentCommand.features.mainPush) return ["text"];
switch (this.$parent.quickcommandInfo.program) {
case "quickcommand":
return _.without(this.outputTypesOptions, "terminal");
return window.lodashM.without(this.outputTypesOptions, "terminal");
case "html":
return ["html"];
default:
@@ -476,7 +476,14 @@ export default {
this.cmdMatch = currentQuickCommandCmds.match;
Object.assign(
this.currentCommand,
_.cloneDeep(_.pick(this.quickcommandInfo, "tags", "output", "features"))
window.lodashM.cloneDeep(
window.lodashM.pick(
this.quickcommandInfo,
"tags",
"output",
"features"
)
)
);
this.setIcon(this.quickcommandInfo.program);
this.platformVerify();

View File

@@ -103,18 +103,18 @@ export default defineComponent({
},
created() {
// 初始化本地配置
this.localConfigs = _.cloneDeep(this.configs);
this.localConfigs = window.lodashM.cloneDeep(this.configs);
},
methods: {
updateConfigs() {
this.$emit("update:configs", _.cloneDeep(this.localConfigs));
this.$emit("update:configs", window.lodashM.cloneDeep(this.localConfigs));
},
},
watch: {
configs: {
deep: true,
handler(newConfigs) {
this.localConfigs = _.cloneDeep(newConfigs);
this.localConfigs = window.lodashM.cloneDeep(newConfigs);
},
},
selectedUA(value) {

View File

@@ -87,7 +87,7 @@ export default defineComponent({
return {
step: 1,
selectedActions: [],
configs: _.cloneDeep(defaultUBrowserConfigs),
configs: window.lodashM.cloneDeep(defaultUBrowserConfigs),
};
},
methods: {

View File

@@ -181,20 +181,20 @@ export default defineComponent({
emits: ["update:configs"],
data() {
return {
localConfigs: _.cloneDeep(this.configs),
localConfigs: window.lodashM.cloneDeep(this.configs),
};
},
methods: {
updateConfig(key, value) {
this.localConfigs.run[key] = value;
this.$emit("update:configs", _.cloneDeep(this.localConfigs));
this.$emit("update:configs", window.lodashM.cloneDeep(this.localConfigs));
},
},
watch: {
configs: {
deep: true,
handler(newConfigs) {
this.localConfigs = _.cloneDeep(newConfigs);
this.localConfigs = window.lodashM.cloneDeep(newConfigs);
},
},
},