Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions library_fdddf_websocket/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
31 changes: 31 additions & 0 deletions library_fdddf_websocket/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
*.log*
.cache
.DS_Store
.idea
.vscode
.eslintcache

# npm
node_modules

# test
**/test/coverage

# dist file
es
lib
dist
dist-theme
assets-package
/site
changelog.generated.md
vetur

*.tgz

# lcap files
.lcap
source.zip
manifest
nasl.extension.*
*@*.zip
3 changes: 3 additions & 0 deletions library_fdddf_websocket/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public/*.js
dist-theme
node_modules
6 changes: 6 additions & 0 deletions library_fdddf_websocket/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tabWidth": 2,
"printWidth": 150,
"singleQuote": true,
"trailingComma": "es5"
}
21 changes: 21 additions & 0 deletions library_fdddf_websocket/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const config = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-onboarding',
'@storybook/addon-interactions',
],
framework: {
name: '@lcap/storybook-vue-vite',
options: {
builder: {
viteConfigPath: './vite.config.js',
},
},
},
docs: {
autodocs: 'tag',
},
};
export default config;
24 changes: 24 additions & 0 deletions library_fdddf_websocket/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Vue from 'vue';
import * as Components from '@/index';

Object.keys(Components).forEach((key) => {
if (Components[key] && Components[key].name) {
Vue.component(Components[key].name, Components[key]);
} else if (Components[key] && typeof Components[key].install === 'function') {
Vue.use(Components[key]);
}
});

const preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
43 changes: 43 additions & 0 deletions library_fdddf_websocket/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Websocket前端使用示例

使用基于websocket的stomp协议,实现前端与后端的交互,后端可发送消息到前端。


## 逻辑详情

### connect

连接stomp服务端
入参: 无
出参: 无

### disconnect

断开连接

入参:无
出参:无

### send

发送消息到服务端

入参:
* body String 消息内容 json字符串 如{"content":"Zhang san","userId":1}

出参:无


## 使用步骤说明

1. 应用引用依赖库
2. 配置应用配置参数 (无需配置)
3. 逻辑调用示例截图

![Snipaste_2024-09-22_20-57-56.jpg](Snipaste_2024-09-22_20-57-56.jpg)

## 应用演示链接

[使用了本依赖库的制品应用链接]

https://dev-websocket-qa.app.codewave.163.com/testwebsocket
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading