This commit is contained in:
手瓜一十雪 committed 2025-01-21 21:43:11 +08:00
1 parent e9e86b3dc3
commit 4b3f672a81
7 files changed
+192 -180

No files matched your search

@@ -30,23 +30,37 @@
import { ref, watch } from 'vue';
import { WebsocketClientConfig } from '../../../../src/onebot/config/config';
const defaultConfig: WebsocketClientConfig = {
name: 'websocket-client',
enable: false,
url: 'ws://localhost:8082',
messagePostFormat: 'array',
reportSelfMessage: false,
reconnectInterval: 5000,
token: '',
debug: false,
heartInterval: 30000
};
const props = defineProps<{
config: WebsocketClientConfig;
}>();
const config = ref(Object.assign({}, defaultConfig, props.config));
const messageFormatOptions = ref([
{ label: 'Array', value: 'array' },
{ label: 'String', value: 'string' },
]);
watch(
() => props.config.messagePostFormat,
() => config.value.messagePostFormat,
(newValue) => {
if (newValue !== 'array' && newValue !== 'string') {
props.config.messagePostFormat = 'array';
config.value.messagePostFormat = 'array';
}
}
);
</script>
<style scoped></style>
<style scoped></style>