mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 06:16:27 +08:00
自动调整高度
This commit is contained in:
parent
715b4bc296
commit
1e260e23f0
@ -23,7 +23,6 @@
|
|||||||
<ResultArea
|
<ResultArea
|
||||||
v-if="isResultShow"
|
v-if="isResultShow"
|
||||||
@frameLoad="frameLoad"
|
@frameLoad="frameLoad"
|
||||||
@expandTrees="outputAutoHeight(fromUtools)"
|
|
||||||
:frameInitHeight="frameInitHeight"
|
:frameInitHeight="frameInitHeight"
|
||||||
:enableHtml="enableHtml"
|
:enableHtml="enableHtml"
|
||||||
:runResultStatus="runResultStatus"
|
:runResultStatus="runResultStatus"
|
||||||
@ -39,7 +38,6 @@
|
|||||||
<ResultArea
|
<ResultArea
|
||||||
v-if="isResultShow"
|
v-if="isResultShow"
|
||||||
@frameLoad="frameLoad"
|
@frameLoad="frameLoad"
|
||||||
@expandTrees="outputAutoHeight(fromUtools)"
|
|
||||||
:frameInitHeight="frameInitHeight"
|
:frameInitHeight="frameInitHeight"
|
||||||
:enableHtml="enableHtml"
|
:enableHtml="enableHtml"
|
||||||
:runResultStatus="runResultStatus"
|
:runResultStatus="runResultStatus"
|
||||||
@ -48,6 +46,7 @@
|
|||||||
:key="timeStamp"
|
:key="timeStamp"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<q-resize-observer @resize="outputAutoHeight" debounce="0" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -238,22 +237,18 @@ export default {
|
|||||||
this.runResultStatus = isSuccess;
|
this.runResultStatus = isSuccess;
|
||||||
if (!_.isArray(content)) content = [content];
|
if (!_.isArray(content)) content = [content];
|
||||||
this.runResult = this.runResult.concat(content);
|
this.runResult = this.runResult.concat(content);
|
||||||
this.outputAutoHeight(this.fromUtools);
|
|
||||||
},
|
},
|
||||||
// 根据输出自动滚动及调整 utools 高度
|
// 根据输出自动滚动及调整 utools 高度
|
||||||
outputAutoHeight(autoHeight = true, autoScroll = true) {
|
outputAutoHeight(e) {
|
||||||
this.$nextTick(() => {
|
let autoScroll = 1;
|
||||||
let clientHeight = document.body.clientHeight;
|
let pluginHeight = e.height < this.maxHeight ? e.height : this.maxHeight;
|
||||||
let pluginHeight =
|
this.fromUtools && utools.setExpendHeight(pluginHeight);
|
||||||
clientHeight < this.maxHeight ? clientHeight : this.maxHeight;
|
autoScroll &&
|
||||||
autoHeight && utools.setExpendHeight(pluginHeight);
|
window.scroll({
|
||||||
autoScroll &&
|
top: e.height,
|
||||||
window.scroll({
|
left: 0,
|
||||||
top: clientHeight,
|
behavior: "smooth",
|
||||||
left: 0,
|
});
|
||||||
behavior: "smooth",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
stopRun() {
|
stopRun() {
|
||||||
this.runResult = [];
|
this.runResult = [];
|
||||||
@ -272,7 +267,6 @@ export default {
|
|||||||
quickcommand.closeWaitButton();
|
quickcommand.closeWaitButton();
|
||||||
},
|
},
|
||||||
frameLoad(initHeight) {
|
frameLoad(initHeight) {
|
||||||
this.outputAutoHeight(this.fromUtools);
|
|
||||||
this.frameInitHeight = initHeight;
|
this.frameInitHeight = initHeight;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -16,12 +16,8 @@
|
|||||||
class="text q-pa-md"
|
class="text q-pa-md"
|
||||||
>
|
>
|
||||||
<div v-for="item in runResult" :key="item">
|
<div v-for="item in runResult" :key="item">
|
||||||
<ObjectTree
|
<ObjectTree :obj="item" v-if="typeof item === 'object'" />
|
||||||
:obj="item"
|
<pre class="result" v-text="item" v-else-if="!!item"></pre>
|
||||||
v-if="typeof item === 'object'"
|
|
||||||
@expandTrees="$emit('expandTrees')"
|
|
||||||
/>
|
|
||||||
<pre class="result" v-text="item" v-else></pre>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -120,7 +120,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
done(children);
|
done(children);
|
||||||
this.$emit("expandTrees");
|
|
||||||
},
|
},
|
||||||
hasChildren(item) {
|
hasChildren(item) {
|
||||||
if (typeof item === "object")
|
if (typeof item === "object")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user