Add no-reload methods

This commit is contained in:
the1812 2022-05-21 19:52:28 +08:00
parent aefae37c72
commit 24a80b134e
5 changed files with 28 additions and 13 deletions

View File

@ -60,8 +60,7 @@ Receive Messages:
- `itemUpdate`
- `stop`
### Debug toolbar
- Updated ${num} features
### Debug widget
- Server connection status
- Action: Disconnect / Reconnect
- Support key bindings / LaunchBar actions

View File

@ -17,11 +17,11 @@
<div class="status-dot disconnected" />
<div class="status-text">未连接</div>
<AsyncButton
title="重新连接"
title="连接"
@click="connect"
>
<VIcon icon="mdi-play" :size="14" />
重新连接
连接
</AsyncButton>
</template>
</div>

View File

@ -179,6 +179,11 @@ export class DevClient extends EventTarget {
}
break
}
case RegistryUpdateMethod.PreferInstantStylesNoReload: {
reloadInstantStyles()
doNotReload()
break
}
case RegistryUpdateMethod.PreferEntry: {
if (isEntryEmpty && reloadInstantStyles()) {
doNotReload()
@ -187,6 +192,13 @@ export class DevClient extends EventTarget {
}
break
}
case RegistryUpdateMethod.PreferEntryNoReload: {
if (isEntryEmpty) {
reloadInstantStyles()
}
doNotReload()
break
}
default:
case RegistryUpdateMethod.DoNotReload: {
doNotReload()

View File

@ -5,11 +5,13 @@
`刷新策略` 决定了收到本体或者功能更新的消息时是否刷新:
本体:
- **自动刷新**: 收到更新时立即刷新页面
- 不自动刷新: 收到更新时不刷新页面
- **总是刷新**: 收到更新时立即刷新页面
- 不刷新: 收到更新时不刷新页面
功能:
- 总是自动刷新: 收到更新时立即刷新页面
- **样式优先**: 功能带有 `instantStyles` 时, 热重载 `instantStyles` 中的样式, 不刷新页面
- 总是刷新: 收到更新时立即刷新页面
- **样式优先**: 功能带有 `instantStyles` 时, 热重载 `instantStyles` 中的样式, 否则刷新页面
- 样式优先 & 不刷新: 在 `样式优先` 前提下, 即使没有 `instantStyles`, 也不要刷新页面
- 逻辑优先: 在 `样式优先` 前提下, 要求功能的 `entry` 不为 `none` 时, 才触发热重载样式, 否则刷新页面
- 不自动刷新: 收到更新时不刷新页面
- 逻辑优先 & 不刷新: 在 `逻辑优先` 前提下, 即使不能触发热重载也不要刷新页面
- 不刷新: 收到更新时不刷新页面

View File

@ -1,10 +1,12 @@
export enum RegistryUpdateMethod {
AlwaysReload = '总是自动刷新',
AlwaysReload = '总是刷新',
PreferInstantStyles = '样式优先',
PreferInstantStylesNoReload = '样式优先 & 不刷新',
PreferEntry = '逻辑优先',
DoNotReload = '不自动刷新',
PreferEntryNoReload = '逻辑优先 & 不刷新',
DoNotReload = '不刷新',
}
export enum CoreUpdateMethod {
AlwaysReload = '自动刷新',
DoNotReload = '不自动刷新',
AlwaysReload = '总是刷新',
DoNotReload = '不刷新',
}