Skip to content

Commit

Permalink
feat: commit codes
Browse files Browse the repository at this point in the history
  • Loading branch information
sonofmagic committed Jul 14, 2024
1 parent a0a9089 commit cb8259b
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 90 deletions.
3 changes: 3 additions & 0 deletions apps/shell-vue-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.5",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.39",
"tailwindcss": "^3.4.4",
"typescript": "^5.2.2",
"vite": "^5.3.1",
"vue-tsc": "^2.0.26"
Expand Down
6 changes: 6 additions & 0 deletions apps/shell-vue-app/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
42 changes: 39 additions & 3 deletions apps/shell-vue-app/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
<script setup lang="ts">
import { reactive } from 'vue'
const apps = reactive([
{
name: 'vue3',
url: '//localhost:8001/',
visible: true
},
{
name: 'vue2',
url: '//localhost:8002/',
visible: false
}
])
function createContext() {
const windowMap = new Map()
return {
}
}
function showApp(index: number) {
apps.forEach((x, idx) => {
x.visible = index === idx
})
}
</script>

<template>
<div>
<WujieVue width="100%" height="100%" name="aaa" url="//localhost:9000/" :sync="true"></WujieVue>
<WujieVue width="100%" height="100%" name="bbb" url="//localhost:3000/" :sync="true"></WujieVue>
<div class="flex">
<div class="w-72 border-r flex flex-col min-h-screen">
<button @click="showApp(0)">切换到 Vue3 项目</button>
<button @click="showApp(1)">切换到 Vue2 项目</button>
</div>
<div class="grow">
<WujieVue v-show="app.visible" :key="app.name" v-for="app in apps" width="100%" height="100%" :name="app.name"
:url="app.url" :sync="true"></WujieVue>
</div>

</div>
</template>

Expand Down
82 changes: 5 additions & 77 deletions apps/shell-vue-app/src/style.css
Original file line number Diff line number Diff line change
@@ -1,79 +1,7 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
@tailwind base;
@tailwind components;
@tailwind utilities;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

.card {
padding: 2em;
}

#app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
html {
@apply bg-slate-900 text-white;
}
11 changes: 11 additions & 0 deletions apps/shell-vue-app/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
'./index.html',
'./src/**/*.{vue,js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
plugins: [],
}
4 changes: 2 additions & 2 deletions apps/vue-app/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "vue-app",
"private": true,
"version": "0.0.0",
"type": "module",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
Expand Down
4 changes: 2 additions & 2 deletions apps/vue-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
server: {
port: 8083
}
port: 8001,
},
})
2 changes: 1 addition & 1 deletion apps/vue2-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
"vite": "^5.3.3",
"vue-tsc": "^2.0.26"
}
}
}
4 changes: 2 additions & 2 deletions apps/vue2-app/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export default {
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
theme: {
extend: {}
extend: {},
},
plugins: []
plugins: [],
}
4 changes: 2 additions & 2 deletions apps/vue2-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import vue from '@vitejs/plugin-vue2'
export default defineConfig({
plugins: [vue()],
server: {
port: 8084
}
port: 8002,
},
})
4 changes: 3 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { icebreaker } from '@icebreakers/eslint-config'

export default icebreaker(
{},
{
vue: true,
},
{
ignores: ['**/fixtures/**'],
},
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cb8259b

Please sign in to comment.