0.6.4 • Published 4 months ago

vtron v0.6.4

Weekly downloads
-
License
-
Repository
-
Last release
4 months ago

vtron, 基于Vue3的 Win10 UI 框架

文档|官网|样例

推荐 Vue 3 + Typescript + Vite + Using <script setup>

English | 中文

本框架可以让你的页面像win10视窗系统一样,运行一个网页上的win10系统。

项目相关讨论可以在Discussions中

GitHub issues GitHub pull requests GitHub GitHub package.json version GitHub last commit GitHub Repo stars GitHub forks

开发流程

使用Github模版

  1. 创建项目 https://github.com/royalknight56/vtron-template

从这个模版仓库创建新的项目。

  1. clone项目

git clone 已经创建好的项目

  1. 修改apps目录下的文件,或者新建app

使用npm,从创建好的vue项目开始

  1. 安装vtron

npm install vtron

  1. 在vue中use插件
import vtron from 'vtron';

引入样式文件"vtron/distlib/style.css"

import 'vtron/distlib/style.css';

usage

import { createApp } from 'vue';
import App from './App.vue';
import vtron from 'vtron';
import 'vtron/distlib/style.css';

createApp(App).use(vtron).mount('#app');
  1. 在页面中引入Screen组件

首先,我们需要创建一个system对象,这个对象管理着系统的所有状态信息。

// App.vue
<Screen></Screen>
<script setup>
import { System } from 'vtron';
let system = new System();
</script>

此步骤之后,run dev已经可以看到win10启动了

  1. 控制屏幕🖥大小

在组件外围包裹一个outer

<div class="outer">
    <Screen></Screen>
  </div>

定义outer样式

<style scoped>
  .outer {
    width: 100vw;
    height: 100vh;
  }
</style>

这样就是占据全部页面显示

  1. 在apps文件夹下新建vue文件,主要在此文件夹中编写窗口内容(非必须)
<template>
  <div class="app">
    <h1>HelloWorld</h1>
  </div>
</template>
  1. 在system中注册app

在system的构造函数传入配置项,

其中 desktop是桌面的配置项,可以配置多个app

如果新加了app,而桌面没有显示,请点击 开始->电源->恢复

进行系统的刷新

<Screen></Screen>
<script setup>
import { System, BrowserWindow } from 'vtron';
import { App } from './apps/App.vue';
import someicon from './assets/someicon.png';
import HelloWorld from './apps/HelloWorld.vue';
let system = new System({
  desktop: [
    {
      name: 'HelloWorld',
      icon: someicon,
      window: {
        content: HelloWorld,
        icon: someicon,
      },
    },
  ],
});
</script>

感谢Star

欢迎PR,意见,想法,感谢各位大佬的支持

npm.io

需要的帮助

我们需要帮助:

目前需要帮助的方向:

文档建设

更加完善的功能:向更加完善的webOS迈进

Thanks

0.6.4

4 months ago

0.6.2-beta.1

5 months ago

0.6.2

5 months ago

0.6.1

5 months ago

0.6.0

5 months ago

0.5.9

5 months ago

0.5.8

5 months ago

0.5.7

5 months ago

0.5.4

6 months ago

0.5.3

6 months ago

0.5.6

6 months ago

0.5.5

6 months ago

0.5.2

6 months ago

0.5.1

7 months ago

0.4.9

7 months ago

0.4.8

8 months ago

0.3.9

9 months ago

0.3.0

11 months ago

0.4.5

9 months ago

0.4.4

9 months ago

0.4.7

8 months ago

0.3.8

9 months ago

0.4.6

8 months ago

0.3.7

9 months ago

0.5.0

7 months ago

0.4.1

9 months ago

0.3.2

11 months ago

0.4.0

9 months ago

0.3.1

11 months ago

0.4.3

9 months ago

0.3.4

10 months ago

0.4.2

9 months ago

0.3.3

10 months ago

0.2.6

12 months ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.0

1 year ago