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

泉州网站建设价格灰色关键词排名优化

泉州网站建设价格,灰色关键词排名优化,河南专业网站建设,公司做官网要多少钱摘要: 官网 今天遇到一个老项目,使用的是ThorUi组件库!之前没有用过这组件库,所以记录一下不同框架是使用情况! ThorUI 是一个基于 Thorium 的 UI 框架,用于构建跨平台的桌面应用程序。如果你打算使用 Thor…

在这里插入图片描述
摘要: 官网

今天遇到一个老项目,使用的是ThorUi组件库!之前没有用过这组件库,所以记录一下不同框架是使用情况!

ThorUI 是一个基于 Thorium 的 UI 框架,用于构建跨平台的桌面应用程序。如果你打算使用 ThorUI 来开发你的应用,以下是一些基本的步骤和示例代码,帮助你入门。

html使用ThorUi:

ThorUI 是一个基于 Thorium 的 UI 框架,用于构建跨平台的桌面应用程序。如果你想在 HTML 中使用 ThorUI,你需要确保你的项目已经正确配置了 Thorium 和 ThorUI。

以下是一个简单的示例,展示如何在 HTML 中使用 ThorUI 来创建一个基本的窗口。

  1. 初始化项目
    首先,创建一个新的目录并初始化一个 Node.js 项目:
mkdir my-thorui-app
cd my-thorui-app
npm init -y
  1. 安装 ThorUI
    在项目目录下安装 ThorUI:
npm install thorium-ui
  1. 创建主文件
    创建一个 main.js 文件,这是你的应用的入口点。
const { app, BrowserWindow } = require('thorium-ui');function createWindow() {// 创建浏览器窗口let win = new BrowserWindow({width: 800,height: 600,webPreferences: {nodeIntegration: true,contextIsolation: false,},});// 加载应用的 HTML 文件win.loadFile('index.html');
}// 当应用准备好时,创建窗口
app.whenReady().then(createWindow);// 当所有窗口关闭时退出应用(除了 macOS)
app.on('window-all-closed', () => {if (process.platform !== 'darwin') {app.quit();}
});app.on('activate', () => {if (BrowserWindow.getAllWindows().length === 0) {createWindow();}
});
  1. 创建 HTML 文件
    创建一个 index.html 文件,作为你的应用界面。
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>My ThorUI App</title><!-- 引入 ThorUI 样式 --><link rel="stylesheet" href="node_modules/thorium-ui/dist/css/thorium-ui.min.css">
</head>
<body><div class="container"><h1>Hello, ThorUI!</h1><button id="myButton" class="btn btn-primary">Click Me</button></div><!-- 引入 ThorUI JavaScript --><script src="node_modules/thorium-ui/dist/js/thorium-ui.min.js"></script><script>// 使用 ThorUI 组件document.getElementById('myButton').addEventListener('click', function() {alert('Button clicked!');});</script>
</body>
</html>
  1. 运行应用
    在项目目录下运行以下命令启动你的应用:
npx electron main.js

vue/uniapp使用ThorUi:
ThorUI 是一个基于 Thorium 的 UI 框架,用于构建跨平台的桌面应用程序。如果你想在 Vue.js 项目中使用 ThorUI,你需要确保你的项目已经正确配置了 Thorium 和 ThorUI。

以下是一个简单的示例,展示如何在 Vue.js 项目中使用 ThorUI 来创建一个基本的窗口。

  1. 初始化项目
    首先,创建一个新的目录并初始化一个 Node.js 项目:
mkdir my-vue-thorui-app
cd my-vue-thorui-app
npm init -y
  1. 安装依赖
    安装 Vue CLI 和其他必要的依赖:
npm install -g @vue/cli
vue create my-vue-app
cd my-vue-app
npm install thorium-ui
  1. 修改 main.js
    在 src 目录下找到 main.js 文件,并进行以下修改:
import { createApp } from 'vue';
import App from './App.vue';
import { app, BrowserWindow } from 'thorium-ui';function createWindow() {// 创建浏览器窗口let win = new BrowserWindow({width: 800,height: 600,webPreferences: {nodeIntegration: true,contextIsolation: false,},});// 加载应用的 HTML 文件win.loadURL('http://localhost:8080');
}// 当应用准备好时,创建窗口
app.whenReady().then(createWindow);// 当所有窗口关闭时退出应用(除了 macOS)
app.on('window-all-closed', () => {if (process.platform !== 'darwin') {app.quit();}
});app.on('activate', () => {if (BrowserWindow.getAllWindows().length === 0) {createWindow();}
});createApp(App).mount('#app');
  1. 修改 public/index.html
    在 public 目录下找到 index.html 文件,并进行以下修改:
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>My Vue ThorUI App</title><!-- 引入 ThorUI 样式 --><link rel="stylesheet" href="node_modules/thorium-ui/dist/css/thorium-ui.min.css">
</head>
<body><div id="app"></div><!-- 引入 ThorUI JavaScript --><script src="node_modules/thorium-ui/dist/js/thorium-ui.min.js"></script>
</body>
</html>
  1. 创建 Vue 组件
    在 src/components 目录下创建一个新的组件文件 HelloWorld.vue:
<template><div class="container"><h1>Hello, ThorUI!</h1><button id="myButton" class="btn btn-primary">Click Me</button></div>
</template><script>
export default {name: 'HelloWorld',mounted() {document.getElementById('myButton').addEventListener('click', function() {alert('Button clicked!');});}
};
</script><style scoped>
.container {text-align: center;margin-top: 50px;
}
</style>
  1. 修改 App.vue
    在 src 目录下找到 App.vue 文件,并进行以下修改:
<template><div id="app"><HelloWorld /></div>
</template><script>
import HelloWorld from './components/HelloWorld.vue';export default {name: 'App',components: {HelloWorld,},
};
</script>
  1. 运行应用
    在项目目录下运行以下命令启动你的应用:
npm run serve

然后,打开另一个终端窗口,运行以下命令启动 Thorium 应用:

npx electron main.js

react使用ThorUi:

ThorUI 是一个基于 Thorium 的 UI 框架,用于构建跨平台的桌面应用程序。如果你想在 React 项目中使用
ThorUI,你需要确保你的项目已经正确配置了 Thorium 和 ThorUI。

以下是一个简单的示例,展示如何在 React 项目中使用 ThorUI 来创建一个基本的窗口。

  1. 初始化项目
    首先,创建一个新的目录并初始化一个 Node.js 项目:
mkdir my-react-thorui-app
cd my-react-thorui-app
npm init -y
  1. 安装依赖
    安装 React 和其他必要的依赖:
npx create-react-app my-react-app
cd my-react-app
npm install thorium-ui
  1. 修改 public/index.html
    在 public 目录下找到 index.html 文件,并进行以下修改:
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>My React ThorUI App</title><!-- 引入 ThorUI 样式 --><link rel="stylesheet" href="node_modules/thorium-ui/dist/css/thorium-ui.min.css">
</head>
<body><div id="root"></div><!-- 引入 ThorUI JavaScript --><script src="node_modules/thorium-ui/dist/js/thorium-ui.min.js"></script>
</body>
</html>
  1. 修改 src/App.js
    在 src 目录下找到 App.js 文件,并进行以下修改:
import React, { useEffect } from 'react';
import { app, BrowserWindow } from 'thorium-ui';function App() {useEffect(() => {function createWindow() {// 创建浏览器窗口let win = new BrowserWindow({width: 800,height: 600,webPreferences: {nodeIntegration: true,contextIsolation: false,},});// 加载应用的 HTML 文件win.loadURL('http://localhost:3000');}// 当应用准备好时,创建窗口app.whenReady().then(createWindow);// 当所有窗口关闭时退出应用(除了 macOS)app.on('window-all-closed', () => {if (process.platform !== 'darwin') {app.quit();}});app.on('activate', () => {if (BrowserWindow.getAllWindows().length === 0) {createWindow();}});}, []);return (<div className="container"><h1>Hello, ThorUI!</h1><button id="myButton" className="btn btn-primary">Click Me</button></div>);
}export default App;
  1. 修改 src/index.js
    在 src 目录下找到 index.js 文件,并进行以下修改:
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';ReactDOM.render(<React.StrictMode><App /></React.StrictMode>,document.getElementById('root')
);// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
  1. 运行应用
    在项目目录下运行以下命令启动你的应用:
npm start

然后,打开另一个终端窗口,运行以下命令启动 Thorium 应用:

npx electron main.js

Angular使用ThorUi:

ThorUI 是一个基于 Thorium 的 UI 框架,用于构建跨平台的桌面应用程序。如果你想在 Angular 项目中使用
ThorUI,你需要确保你的项目已经正确配置了 Thorium 和 ThorUI。

以下是一个简单的示例,展示如何在 Angular 项目中使用 ThorUI 来创建一个基本的窗口。

  1. 初始化项目
    首先,创建一个新的目录并初始化一个 Node.js 项目:
mkdir my-angular-thorui-app
cd my-angular-thorui-app
npm init -y
  1. 安装依赖
    安装 Angular CLI 和其他必要的依赖:
npm install -g @angular/cli
ng new my-angular-app
cd my-angular-app
npm install thorium-ui
  1. 修改 src/index.html
    在 src 目录下找到 index.html 文件,并进行以下修改:
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>My Angular ThorUI App</title><!-- 引入 ThorUI 样式 --><link rel="stylesheet" href="node_modules/thorium-ui/dist/css/thorium-ui.min.css">
</head>
<body><app-root></app-root><!-- 引入 ThorUI JavaScript --><script src="node_modules/thorium-ui/dist/js/thorium-ui.min.js"></script>
</body>
</html>
  1. 修改 src/app/app.component.ts
    在 src/app 目录下找到 app.component.ts 文件,并进行以下修改:
import { Component, OnInit } from '@angular/core';
import { app, BrowserWindow } from 'thorium-ui';@Component({selector: 'app-root',templateUrl: './app.component.html',styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {title = 'My Angular ThorUI App';ngOnInit() {function createWindow() {// 创建浏览器窗口let win = new BrowserWindow({width: 800,height: 600,webPreferences: {nodeIntegration: true,contextIsolation: false,},});// 加载应用的 HTML 文件win.loadURL('http://localhost:4200');}// 当应用准备好时,创建窗口app.whenReady().then(createWindow);// 当所有窗口关闭时退出应用(除了 macOS)app.on('window-all-closed', () => {if (process.platform !== 'darwin') {app.quit();}});app.on('activate', () => {if (BrowserWindow.getAllWindows().length === 0) {createWindow();}});}
}
  1. 修改 src/app/app.component.html
    在 src/app 目录下找到 app.component.html 文件,并进行以下修改:
<div class="container"><h1>{{ title }}</h1><button id="myButton" class="btn btn-primary">Click Me</button>
</div>
  1. 运行应用
    在项目目录下运行以下命令启动你的应用:
ng serve

然后,打开另一个终端窗口,运行以下命令启动 Thorium 应用:

npx electron main.js
http://www.ds6.com.cn/news/52155.html

相关文章:

  • 手机网站制作流程淘宝流量
  • ssc网站建设6个好用的bt种子搜索引擎
  • 网站建设专家cms链接制作软件
  • 策划方案免费网站百度搜图
  • 沧州手机网站建设百度识图网页入口
  • 深圳今天最新疫情报告烟台seo外包
  • 在线酒店预定网站制作关键词分为哪三类
  • 济南 域名注册 网站建设it培训机构哪个好一点
  • 莱芜区组织部网站长春做网站推广的公司
  • 做网站用的浏览器有哪些常州网站建设优化
  • 做视频网站都需要什么软件下载百度关键词优化教程
  • 网站建设的论文的参考文献百度趋势搜索
  • 政府网站建设经费预算方案云南seo
  • wordpress 排版代码西安seo网站优化
  • 表单大师做网站重庆seo网站收录优化
  • cms网站是什么意思网络营销心得体会300字
  • 网络推广网站河南云南seo公司
  • 电商平台诈骗怎么解决seo技术自学
  • 长沙哪里学网站建设华与华营销策划公司
  • 北京做网站设计招聘app001推广平台官网
  • 响应式自适应网站模板磁力兔子搜索引擎
  • 建设公司名字智谋网站优化公司
  • 网站建设工作具体内容360排名检测
  • 兴力网站建设行业关键词
  • 南阳网站搭建如何做网络推广
  • 向国外卖货的电商平台成都seo优化外包公司
  • iis网站服务器 建立出现问题汕头网站建设开发
  • 山西太原今天重大新闻seo广告优化多少钱
  • 武汉便宜的做网站公司怎么快速推广app
  • 江西网站开发联系方式网上推广企业