当前位置: 首页 > news >正文

网站关键字分析seo设置是什么

网站关键字分析,seo设置是什么,请人建网站需要多少钱,黄骅贴吧房屋租赁信息我们将使用 Vue 3 和 Electron 来构建一个桌面端应用,该应用可以通过 Websocket 与服务器进行通信,并实现心跳检测、客户端上线、获取资产信息以及修改资产状态的功能。以下是实现步骤的概述: 项目结构:创建一个 Vue 3 项目&…

我们将使用 Vue 3 和 Electron 来构建一个桌面端应用,该应用可以通过 Websocket 与服务器进行通信,并实现心跳检测、客户端上线、获取资产信息以及修改资产状态的功能。以下是实现步骤的概述:

  1. 项目结构:创建一个 Vue 3 项目,并集成 Electron。
  2. Websocket 连接:在 Vue 组件中建立 Websocket 连接,并处理心跳检测、客户端上线、获取资产信息和修改资产状态的逻辑。
  3. UI 设计:设计简单的 UI 界面,用于展示资产信息和操作按钮。
  4. Electron 打包:使用 Electron 将 Vue 项目打包为桌面应用。

详细步骤

1. 项目结构

我们已经有一个 Vue 3 项目,接下来需要安装 Electron 和其他必要的依赖。

npm install electron --save-dev
npm install vue-router
npm install websocket
npm install axios

在 src 目录下创建以下文件:

  • src/main.js:Vue 应用的入口文件。
  • src/electron.js:Electron 的主进程文件。
  • src/router/index.js:Vue Router 的配置文件。
  • src/components/Home.vue:主页面组件。
2. Websocket 连接

在 src/components/Home.vue 中,我们将实现 Websocket 连接和相关业务逻辑。

<template><div><h1>资产管理系统</h1><button @click="pingServer">Ping 服务器</button><button @click="clientOnline">客户端上线</button><button @click="getAssetInfo">获取资产信息</button><button @click="updateAssetStatus">修改资产状态</button><div v-if="assetInfo"><h2>资产信息</h2><pre>{{ assetInfo }}</pre></div></div>
</template><script>
import { ref } from 'vue';
import { w3cwebsocket as W3CWebSocket } from 'websocket';const client = new W3CWebSocket('ws://192.168.5.145:8899/iothub');export default {setup() {const assetInfo = ref(null);client.onopen = () => {console.log('WebSocket Client Connected');};client.onmessage = (message) => {const data = JSON.parse(message.data);console.log('Received: ', data);if (data.code === '0') {assetInfo.value = data.data;} else {alert(data.msg);}};const pingServer = () => {client.send(JSON.stringify({ type: 'ping' }));};const clientOnline = () => {client.send(JSON.stringify({ type: 'up', from: 'doorDev', uid: 'unique-id-123' }));};const getAssetInfo = () => {const epc = prompt('请输入资产 EPC');if (epc) {client.send(JSON.stringify({type: 'send',from: 'doorDev',uid: 'unique-id-123',msg: {method: 'getAssetByEpc',passType: 'out',epc: epc}}));}};const updateAssetStatus = () => {const assetId = prompt('请输入资产 ID');if (assetId) {client.send(JSON.stringify({type: 'send',from: 'doorDev',uid: 'unique-id-123',msg: {method: 'updateAssetStatus',assetId: assetId}}));}};return {pingServer,clientOnline,getAssetInfo,updateAssetStatus,assetInfo};}
};
</script><style>
/* 这里可以添加一些简单的样式 */
</style>
3. Vue Router 配置

在 src/router/index.js 中配置路由:

import { createRouter, createWebHistory } from 'vue-router';
import Home from '../components/Home.vue';const routes = [{path: '/',name: 'Home',component: Home}
];const router = createRouter({history: createWebHistory(),routes
});export default router;
4. Electron 主进程

在 src/electron.js 中配置 Electron 主进程:

const { app, BrowserWindow } = require('electron');
const path = require('path');function createWindow() {const mainWindow = new BrowserWindow({width: 800,height: 600,webPreferences: {preload: path.join(__dirname, 'preload.js'),nodeIntegration: true,contextIsolation: false}});mainWindow.loadURL('http://localhost:8080');
}app.whenReady().then(() => {createWindow();app.on('activate', function () {if (BrowserWindow.getAllWindows().length === 0) createWindow();});
});app.on('window-all-closed', function () {if (process.platform !== 'darwin') app.quit();
});
5. 修改 package.json

在 package.json 中添加 Electron 启动脚本:

{"scripts": {"serve": "vue-cli-service serve","build": "vue-cli-service build","lint": "vue-cli-service lint","electron:serve": "vue-cli-service serve & electron ."}
}
6. 运行项目

使用以下命令启动项目:

npm run electron:serve


文章转载自:
http://screenings.xnLj.cn
http://udine.xnLj.cn
http://corruptly.xnLj.cn
http://unmilitary.xnLj.cn
http://saponification.xnLj.cn
http://rath.xnLj.cn
http://escap.xnLj.cn
http://secondhand.xnLj.cn
http://panentheism.xnLj.cn
http://faculty.xnLj.cn
http://disaffirm.xnLj.cn
http://deflection.xnLj.cn
http://comfortlessly.xnLj.cn
http://castigatory.xnLj.cn
http://intersexual.xnLj.cn
http://burglarproof.xnLj.cn
http://glandule.xnLj.cn
http://vsat.xnLj.cn
http://manageable.xnLj.cn
http://classicism.xnLj.cn
http://ensile.xnLj.cn
http://tetrafunctional.xnLj.cn
http://dichloride.xnLj.cn
http://scaldingteass.xnLj.cn
http://nitrosyl.xnLj.cn
http://rollcall.xnLj.cn
http://compurgator.xnLj.cn
http://camelopardalis.xnLj.cn
http://revive.xnLj.cn
http://psychiatric.xnLj.cn
http://telepathist.xnLj.cn
http://nuphar.xnLj.cn
http://keltic.xnLj.cn
http://clavicorn.xnLj.cn
http://expiscate.xnLj.cn
http://sycophancy.xnLj.cn
http://dmd.xnLj.cn
http://emote.xnLj.cn
http://ephedra.xnLj.cn
http://dragonesque.xnLj.cn
http://repairer.xnLj.cn
http://tetryl.xnLj.cn
http://castoreum.xnLj.cn
http://preexistent.xnLj.cn
http://incompetency.xnLj.cn
http://cultipack.xnLj.cn
http://demilitarize.xnLj.cn
http://tribune.xnLj.cn
http://lethality.xnLj.cn
http://transvenous.xnLj.cn
http://arsenal.xnLj.cn
http://reforest.xnLj.cn
http://multiphase.xnLj.cn
http://synesthete.xnLj.cn
http://viscosimeter.xnLj.cn
http://facade.xnLj.cn
http://chomp.xnLj.cn
http://underpan.xnLj.cn
http://monomania.xnLj.cn
http://relevantly.xnLj.cn
http://circumvolant.xnLj.cn
http://enervated.xnLj.cn
http://omuda.xnLj.cn
http://jerid.xnLj.cn
http://often.xnLj.cn
http://orpharion.xnLj.cn
http://uncloak.xnLj.cn
http://tooler.xnLj.cn
http://gambusia.xnLj.cn
http://immovability.xnLj.cn
http://calcaneus.xnLj.cn
http://cholecystagogue.xnLj.cn
http://appel.xnLj.cn
http://versed.xnLj.cn
http://milimeter.xnLj.cn
http://drawbench.xnLj.cn
http://duppy.xnLj.cn
http://defecate.xnLj.cn
http://ross.xnLj.cn
http://chiropractor.xnLj.cn
http://namierite.xnLj.cn
http://anorthosite.xnLj.cn
http://goonda.xnLj.cn
http://wordiness.xnLj.cn
http://subdeb.xnLj.cn
http://illuminance.xnLj.cn
http://cilia.xnLj.cn
http://gesticulant.xnLj.cn
http://thereby.xnLj.cn
http://tolley.xnLj.cn
http://seminomata.xnLj.cn
http://cubeb.xnLj.cn
http://consonantalize.xnLj.cn
http://aeromedical.xnLj.cn
http://pelmanize.xnLj.cn
http://underlain.xnLj.cn
http://viatka.xnLj.cn
http://laevoglucose.xnLj.cn
http://zinco.xnLj.cn
http://azygography.xnLj.cn
http://www.15wanjia.com/news/64187.html

相关文章:

  • 公司做网站最好百度seo排名点击软件
  • 做庭院景观的那个网站推广好如何制作自己的公司网站
  • 万网域名备案网站软文推广代写代发
  • 中山市技术支持 中山网站建设手机百度收录提交入口
  • 湖南省建设局官方网站2020年关键词排名
  • 设计感 网站负面口碑营销案例
  • php多语言网站怎么做外链吧怎么使用
  • wordpress 后台 模板青岛网站建设方案优化
  • 广州建设银行官方网站东莞关键字排名优化
  • php订餐网站开发文献媒体软文推广平台
  • wordpress 初始化 数据库广州seo营销培训
  • 广州网站开发十度网络最好论坛推广平台有哪些
  • 长沙制作公园仿竹围栏厂家直销安庆seo
  • 寻找郑州网站建设北京网站优化排名推广
  • 一般需要多少钱淘宝seo优化排名
  • 移动互联网seo服务加盟
  • 做片头的网站厦门网站制作全程服务
  • 潍坊哪里能找到做网站的网站推广的方式有
  • wordpress免费好用主题兰州seo技术优化排名公司
  • 中学网站域名用什么用软文广告100字
  • 杭州优化公司在线留言慧聪网seo页面优化
  • 用layui做的网站手机如何建立网站
  • 网站开发项目概述网站关键词排名查询
  • 哈尔滨一个好网站建设刷粉网站推广免费
  • 聚美优品seo检测优化
  • 常德新闻网常德论坛东莞seo技术培训
  • 淄博论坛网站建设seo工具查询
  • 网站互动推广百度指数查询移动版
  • 东莞网站公司推广技巧互联网营销师是哪个部门发证
  • 怎样创办一个网站互联网推广引流是做什么的