初始化

master
yutent 2023-04-13 16:34:13 +08:00
commit 0364c91974
15 changed files with 203 additions and 0 deletions

16
.gitignore vendored Normal file
View File

@ -0,0 +1,16 @@
dist
node_modules
*.sublime-project
*.sublime-workspace
package-lock.json
._*
.Spotlight-V100
.Trashes
.DS_Store
.AppleDouble
.LSOverride

11
.prettierrc.yaml Normal file
View File

@ -0,0 +1,11 @@
jsxBracketSameLine: true
jsxSingleQuote: true
semi: false
singleQuote: true
printWidth: 80
useTabs: false
tabWidth: 2
trailingComma: none
bracketSpacing: true
arrowParens: avoid

18
index.html Normal file
View File

@ -0,0 +1,18 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>{{title}}</title>
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<link rel="stylesheet" href="//jscdn.ink/@bytedo/wcui/1.0.12/css/reset-basic.css">
<script async src="//jscdn.ink/es-module-shims/1.6.3/es-module-shims.wasm.js"></script>
<script type="importmap">{{importmap}}</script>
</head>
<body>
<div class="app noselect"></div>
<script src="main.js"></script>
</body>
</html>

11
package.json Normal file
View File

@ -0,0 +1,11 @@
{
"name": "fite-app",
"type": "module",
"scripts": {
"start": "fite dev",
"build": "fite build"
},
"devDependencies": {
"fite": "^0.5.0"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

1
src/assets/logo.svg Normal file
View File

@ -0,0 +1 @@
<svg viewBox="0 0 261.76 226.69" xmlns="http://www.w3.org/2000/svg"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/><path d="M36.21 192.639l160.921-74.805-81.778-5.063 119.519-67.69L49.06 126.138l88.8 2.712z" fill="rgb(252, 118, 97)"/></svg>

After

Width:  |  Height:  |  Size: 394 B

View File

@ -0,0 +1,29 @@
<template>
<div class="code-editor" ref="container"></div>
</template>
<script>
import { EditorView, minimalSetup, vue, js, css, html } from '@bytedo/editor'
export default {
props: {
lang: { type: String, default: 'vue' },
code: String
},
mounted() {
this.$view = new EditorView({
doc: '',
extensions: minimalSetup(vue()),
parent: this.$refs.container
})
}
}
</script>
<style>
.cm-editor {
width: 100%;
height: 100%;
}
</style>

0
src/pages/index/main.js Normal file
View File

23
src/pages/index/router.js Normal file
View File

@ -0,0 +1,23 @@
import { createRouter, createWebHistory } from 'vue-router'
import Home from './views/home.vue'
const router = createRouter({
history: createWebHistory(),
routes: [
{
path: '/',
name: 'home',
component: Home
},
{
path: '/about',
name: 'about',
component: () => import('./views/about.vue')
}
]
})
export default router

View File

@ -0,0 +1,13 @@
<template>
<CodeEditor></CodeEditor>
</template>
<script>
import CodeEditor from '@/components/code-editor.vue'
export default {
components: { CodeEditor }
}
</script>
<style lang="scss"></style>

View File

@ -0,0 +1,8 @@
import { createApp } from 'vue'
import App from './app.vue'
import store from './store'
const app = createApp(App)
app.use(router).use(store).mount('.app')

View File

@ -0,0 +1,11 @@
import { reactive } from 'vue'
const store = reactive({
foo: 'bar',
version: '0.5.0'
})
export default function (app) {
app.config.globalProperties.$store = store
}

View File

@ -0,0 +1,18 @@
<script>
export default {
data(){
return {
content: '这是关于我们页面'
}
}
}
</script>
<template>
<main>
<h1>{{content}}</h1>
<cite>当前vue-live版本: v{{$store.version}}</cite>
</main>
</template>

View File

@ -0,0 +1,17 @@
<script>
export default {
data(){
return {
content: '欢迎访问~~ 这是首页'
}
}
}
</script>
<template>
<main>
<h1>{{content}}</h1>
</main>
</template>

27
vue.live.js Normal file
View File

@ -0,0 +1,27 @@
import { resolve } from 'path'
export default {
devServer: {
port: 8080,
domain: '',
https: false,
ssl: {
key: '',
cert: ''
// ca: ''
}
},
pages: {
playground: {
entry: resolve('./src/pages/playground/main.js'),
title: '@bd/ui Playground'
}
},
imports: {
vue: '//jscdn.ink/vue/3.2.47/vue.runtime.esm-browser.prod.js',
'vue-router': '//jscdn.ink/@bytedo/vue-router/4.1.6/vue-router.js',
fetch: '//jscdn.ink/@bytedo/fetch/2.1.5/next.js',
'@bytedo/editor': '//jscdn.ink/@bytedo/editor/1.0.0/index.js'
}
}