Skip to content

Commit

Permalink
feat
Browse files Browse the repository at this point in the history
  • Loading branch information
royalknight56 committed Jun 11, 2024
1 parent 843c65a commit 6822d41
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 36 deletions.
4 changes: 2 additions & 2 deletions packages/vtron-demo/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-->
<template>
<div class="outer">
<VtronScreen :system="system"></VtronScreen>
<Screen :system="system"></Screen>
<!-- 一定需要引入Win10组件,组件已经在use时注册了 -->
</div>
<a style="display: none" href="https://beian.miit.gov.cn/">豫ICP备19041315号</a>
Expand All @@ -14,7 +14,7 @@
<script lang="ts" setup>
import { desktopConfig, magnetConfig } from './DesktopSet';

import { System, BrowserWindow, Notify } from 'vtron';
import { System, BrowserWindow, Notify, Screen } from 'vtron';
import { vtronPlus } from 'vtron-plus';
import MarkDown from './components/apps/MarkDown.vue';
import 'vtron-plus/distlib/style.css';
Expand Down
3 changes: 1 addition & 2 deletions packages/vtron-demo/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { createApp } from 'vue';
import App from './App.vue';
// Main中引入vtron,并且引入样式文件
import vtron from 'vtron';
import 'vtron/distlib/style.css';
import 'xterm/css/xterm.css';

Expand All @@ -19,7 +18,7 @@ import 'mavon-editor/dist/css/index.css';
// import 'primevue/resources/themes/lara-light-green/theme.css';
// use引入的插件,第二个选项是配置项
const app = createApp(App);
app.use(vtron).use(mavonEditor).mount('#app');
app.use(mavonEditor).mount('#app');

Sentry.init({
app,
Expand Down
3 changes: 2 additions & 1 deletion packages/vtron-plus/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { System } from 'vtron';
import { vtronPlus } from './packages/plug';
import { Screen } from 'vtron';
const system = new System({
rootStyle: {},
Expand All @@ -12,7 +13,7 @@ system.whenReady().then(() => {

<template>
<div class="outer">
<Screen></Screen>
<Screen :system="system"></Screen>
</div>
</template>

Expand Down
3 changes: 1 addition & 2 deletions packages/vtron-plus/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import vtron from 'vtron';
import 'vtron/distlib/style.css';
import { createApp } from 'vue';
import App from './App.vue';
import './style.css';
// import 'xterm/css/xterm.css'
createApp(App).use(vtron).mount('#app');
createApp(App).mount('#app');
4 changes: 2 additions & 2 deletions packages/vtron/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-->
<template>
<div class="outer">
<VtronScreen :system="sys"></VtronScreen>
<Screen :system="sys"></Screen>
</div>
</template>

Expand All @@ -18,7 +18,7 @@ import VtronTest from './apps/VtronTest.vue';
import VtronPerfTest from './apps/VtronPerfTest.vue';

import { onMounted } from 'vue';
import { System, VtronFile } from './packages/plug';
import { System, VtronFile, Screen } from './packages/plug';
import vtronLogoIcon from './assets/vtron-icon-nobg.png';
import { Tray, Menu } from '@/packages/services';

Expand Down
3 changes: 1 addition & 2 deletions packages/vtron/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
import { createApp } from 'vue';
import App from './App.vue';
import Win10 from './packages/plug';

const app = createApp(App).use(Win10);
const app = createApp(App);
app.mount('#app-hash');
29 changes: 11 additions & 18 deletions packages/vtron/src/packages/plug.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ScreenComponentVue } from '@packages/ui';
import WinButtonVue from './components/WinButton.vue';
import WinCheckBox from './components/WinCheckBox.vue';
import WinInput from './components/WinInput.vue';
Expand All @@ -8,23 +7,6 @@ import WinProcess from './components/WinProcess.vue';
import WinSelect from './components/WinSelect.vue';
import WinUpButtonGroupVue from './components/WinUpButtonGroup.vue';

export {
WinButtonVue,
WinCheckBox,
WinInput,
WinLoadingVue,
WinLogoVue,
WinProcess,
WinSelect,
WinUpButtonGroupVue,
};

const plug = {
install: function (app: any): any {
app.component('VtronScreen', ScreenComponentVue);
},
};
export default plug;
export type { VtronFileInterface } from '@/packages/kernel/file/FIleInterface';
export * from '@/packages/kernel/file/FileSystem';
export * from '@/packages/kernel/shell/Shell';
Expand All @@ -36,4 +18,15 @@ export { i18n } from '@/packages/ui/i18n';
export { vDragable } from '@/packages/ui/windowGroup/MakeDragable';
export * from '@/packages/util/Path';
export type { SystemOptions, WinApp } from '@packages/type/type';
export { ScreenComponentVue as Screen } from '@packages/ui';
export { dealIcon } from '@packages/util/Icon';
export {
WinButtonVue,
WinCheckBox,
WinInput,
WinLoadingVue,
WinLogoVue,
WinProcess,
WinSelect,
WinUpButtonGroupVue,
};
12 changes: 5 additions & 7 deletions packages/vtron/src/packages/ui/screen/ScreenComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
<script lang="ts" setup>
import { System } from '@packages/kernel';
import ScreenContent from './ScreenContent.vue';
import { provide } from 'vue';
import { onMounted, provide } from 'vue';
const props = defineProps<{
system: System;
}>();
const props = defineProps({
system: {
type: System,
default: null,
},
});
provide('system', props.system);
</script>
<style lang="scss" scoped>
Expand Down

0 comments on commit 6822d41

Please sign in to comment.