commit 59157e181b668dd5f208e115d5486cec7aae5725 Author: yutent Date: Sat Mar 25 23:23:17 2023 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2dde5ab --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ + +dist +node_modules + +*.sublime-project +*.sublime-workspace +package-lock.json + +._* + +.Spotlight-V100 +.Trashes +.DS_Store +.AppleDouble +.LSOverride + diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000..6734234 --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,11 @@ + +jsxBracketSameLine: true +jsxSingleQuote: true +semi: false +singleQuote: true +printWidth: 80 +useTabs: false +tabWidth: 2 +trailingComma: none +bracketSpacing: true +arrowParens: avoid diff --git a/index.html b/index.html new file mode 100644 index 0000000..94daac9 --- /dev/null +++ b/index.html @@ -0,0 +1,18 @@ + + + + + + + {{title}} + + + + + + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..c3e5eb3 --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "name": "fite-app", + "type": "module", + "scripts": { + "start": "fite dev", + "build": "fite build" + }, + "devDependencies": { + "fite": "^0.4.0" + } +} \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..df36fcf Binary files /dev/null and b/public/favicon.ico differ diff --git a/src/app.vue b/src/app.vue new file mode 100644 index 0000000..5902604 --- /dev/null +++ b/src/app.vue @@ -0,0 +1,63 @@ + + + + + + + + diff --git a/src/assets/logo.svg b/src/assets/logo.svg new file mode 100644 index 0000000..e2a9ebf --- /dev/null +++ b/src/assets/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/hello.vue b/src/components/hello.vue new file mode 100644 index 0000000..db00953 --- /dev/null +++ b/src/components/hello.vue @@ -0,0 +1,40 @@ + + + + + + + diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..e926443 --- /dev/null +++ b/src/main.js @@ -0,0 +1,11 @@ + +import { createApp } from 'vue' +import App from './app.vue' + +import router from './router' +import store from './store' + +const app = createApp(App) + +app.use(router).use(store).mount('.app') + diff --git a/src/router.js b/src/router.js new file mode 100644 index 0000000..ea669d0 --- /dev/null +++ b/src/router.js @@ -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 + + diff --git a/src/store.js b/src/store.js new file mode 100644 index 0000000..16526b1 --- /dev/null +++ b/src/store.js @@ -0,0 +1,11 @@ + +import { reactive } from 'vue' + +const store = reactive({ + foo: 'bar', + version: '0.4.0' +}) + +export default function (app) { + app.config.globalProperties.$store = store +} diff --git a/src/views/about.vue b/src/views/about.vue new file mode 100644 index 0000000..24aa159 --- /dev/null +++ b/src/views/about.vue @@ -0,0 +1,18 @@ + + + + + diff --git a/src/views/home.vue b/src/views/home.vue new file mode 100644 index 0000000..987c694 --- /dev/null +++ b/src/views/home.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/vue.live.js b/vue.live.js new file mode 100644 index 0000000..f0b1d48 --- /dev/null +++ b/vue.live.js @@ -0,0 +1,36 @@ +import { resolve } from 'path' + +export default { + devServer: { + port: 8080, + domain: '', + https: false, + ssl: { + key: '', + cert: '' + // ca: '' + } + }, + pages: { + // 如果多页应用, 则这里写传入多个值即可(注意不是数组格式) + // 这里的key值, 将是最终的页面的名称 + index: { + // 这里的resolve可将相对路径转为绝对路径 + // 如果传入的路径已经是绝对路径的, 可不需要resolve + entry: resolve('./src/main.js'), + title: 'vue-live 应用示例' + } + }, + // 以下cdn地址, 可自行修改为适合的 + // 有用到其他的库, 可以手动添加, + // 也可以在页面中直接引入完整的路径, 而不必须在这里声明 + imports: { + vue: '//jscdn.ink/vue/3.2.47/vue.runtime.esm-browser.prod.js', + // 这个vue-router库, 移除了 @vue/devtools-api 相关的代码。 以达到减少不必须的体积的效果 + // 如需要支持devtools的, 请修改为原版vue-router地址即可。 + // 'vue-router': '//jscdn.ink/@bytedo/vue-router/4.1.6/vue-router.js', + // 'vue-router': '//jscdn.ink/vue-router/4.1.6/vue-router.esm-browser.js', + // '@vue/devtools-api': '//jscdn.ink/@vue/devtools-api/6.5.0/esm/index.js', + fetch: '//jscdn.ink/@bytedo/fetch/2.1.5/next.js' + } +}