-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: 修复搜索后滚动加载问题(#1590) #1613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
fix: 修复搜索后滚动加载问题(#1590) #1613
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,12 +252,13 @@ | |
<AppAvatar v-else class="mr-8 avatar-blue" shape="square" :size="32"> | ||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" /> | ||
</AppAvatar> | ||
<auto-tooltip | ||
:content="relatedObject(datasetList, item, 'id')?.name" | ||
style="width: 80%" | ||
|
||
<span | ||
class="ellipsis cursor" | ||
:title="relatedObject(datasetList, item, 'id')?.name" | ||
> | ||
{{ relatedObject(datasetList, item, 'id')?.name }}</span | ||
> | ||
{{ relatedObject(datasetList, item, 'id')?.name }} | ||
</auto-tooltip> | ||
</div> | ||
<el-button text @click="removeDataset(item)"> | ||
<el-icon> | ||
|
@@ -326,7 +327,11 @@ | |
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon> | ||
</el-tooltip> --> | ||
</div> | ||
<el-switch size="small" v-model="applicationForm.stt_model_enable" @change="sttModelEnableChange"/> | ||
<el-switch | ||
size="small" | ||
v-model="applicationForm.stt_model_enable" | ||
@change="sttModelEnableChange" | ||
/> | ||
</div> | ||
</template> | ||
<el-select | ||
|
@@ -406,7 +411,11 @@ | |
<el-icon class="mr-4"><Setting /></el-icon> | ||
设置 | ||
</el-button> | ||
<el-switch size="small" v-model="applicationForm.tts_model_enable" @change="ttsModelEnableChange"/> | ||
<el-switch | ||
size="small" | ||
v-model="applicationForm.tts_model_enable" | ||
@change="ttsModelEnableChange" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
@@ -527,7 +536,7 @@ | |
</h4> | ||
</div> | ||
<div class="scrollbar-height"> | ||
<AiChat :data="applicationForm"></AiChat> | ||
<AiChat :applicationDetails="applicationForm"></AiChat> | ||
</div> | ||
</div> | ||
</el-col> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 该代码存在一些差异:
关于优化:由于是文本处理应用,可以考虑到的是增加元素之间的间距使布局更紧凑;考虑对字体大小进行调整以减少视觉累赘;在某些情况下将复杂的信息分段显示可能有助于阅读体验等。这都取决于具体的UI设计方案和个人喜好而定。 |
||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码中存在一些问题和可能改进的地方:
ref
和computed
的使用:在计算属性 (computed
) 中不能直接访问父组件的数据,因此可以尝试在子组件内部定义一个局部变量代替。修改后的代码示例:
这里主要调整了对
$refs.childComponentRef
的引用到全局对象 $store.state 和本地存储的更新方式。2. 使用生命周期钩子:
v-size-scale
或者自定义监听器函数进行尺寸改变时自动增加/减少条数的逻辑,new Vue({
},
...
data:{
page_size: props.pageSize
... 其他配置 …...
}
});
再根据实际需求修改页面内容大小变化触发点等策略,比如添加事件监听机制让每轮刷新都按照指定条件动态调大屏幕显示数量; 3. 定期运行定时器更新条目的请求:
javascriptthis.$http.get(
api.php
).then((res)=>{})
.setInterval(()=>{
this.loadItems();//这里的 loadItems 看似是异步加载,但其实只是重定界符,并不是真正的异步操作!
},5 * 10*1000)
;