mirror of
https://gitee.com/dcloud/uni-preset-vue
synced 2025-04-20 20:26:22 +08:00
init
This commit is contained in:
parent
479f72eb03
commit
c218ad3eda
@ -9,6 +9,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"><!--app-html--></div>
|
<div id="app"><!--app-html--></div>
|
||||||
<script type="module" src="/src/main.js"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
"@dcloudio/uni-cli-shared": "^3.0.0-alpha-3030020211201003",
|
"@dcloudio/uni-cli-shared": "^3.0.0-alpha-3030020211201003",
|
||||||
"@dcloudio/vite-plugin-uni": "^3.0.0-alpha-3030020211201003",
|
"@dcloudio/vite-plugin-uni": "^3.0.0-alpha-3030020211201003",
|
||||||
"autoprefixer": "^10.4.0",
|
"autoprefixer": "^10.4.0",
|
||||||
|
"typescript": "^4.5.2",
|
||||||
"vite": "^2.6.14"
|
"vite": "^2.6.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
28
src/App.vue
28
src/App.vue
@ -1,17 +1,13 @@
|
|||||||
<script>
|
<script setup lang="ts">
|
||||||
export default {
|
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
|
||||||
onLaunch: function () {
|
onLaunch(() => {
|
||||||
console.log('App Launch')
|
console.log("App Launch");
|
||||||
},
|
});
|
||||||
onShow: function () {
|
onShow(() => {
|
||||||
console.log('App Show')
|
console.log("App Show");
|
||||||
},
|
});
|
||||||
onHide: function () {
|
onHide(() => {
|
||||||
console.log('App Hide')
|
console.log("App Hide");
|
||||||
},
|
});
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
<style></style>
|
||||||
<style>
|
|
||||||
/*每个页面公共css */
|
|
||||||
</style>
|
|
||||||
|
8
src/env.d.ts
vendored
Normal file
8
src/env.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
declare module '*.vue' {
|
||||||
|
import { DefineComponent } from 'vue'
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
||||||
|
const component: DefineComponent<{}, {}, any>
|
||||||
|
export default component
|
||||||
|
}
|
10
src/main.js
10
src/main.js
@ -1,10 +0,0 @@
|
|||||||
import {
|
|
||||||
createSSRApp
|
|
||||||
} from "vue";
|
|
||||||
import App from "./App.vue";
|
|
||||||
export function createApp() {
|
|
||||||
const app = createSSRApp(App);
|
|
||||||
return {
|
|
||||||
app,
|
|
||||||
};
|
|
||||||
}
|
|
8
src/main.ts
Normal file
8
src/main.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { createSSRApp } from "vue";
|
||||||
|
import App from "./App.vue";
|
||||||
|
export function createApp() {
|
||||||
|
const app = createSSRApp(App);
|
||||||
|
return {
|
||||||
|
app,
|
||||||
|
};
|
||||||
|
}
|
@ -1,22 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<image class="logo" src="/static/logo.png"></image>
|
<image class="logo" src="/static/logo.png" />
|
||||||
<view class="text-area">
|
<view class="text-area">
|
||||||
<text class="title">{{ title }}</text>
|
<text class="title">{{ title }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup lang="ts">
|
||||||
export default {
|
import { ref } from 'vue'
|
||||||
data() {
|
const title = ref('Hello')
|
||||||
return {
|
|
||||||
title: 'Hello',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {},
|
|
||||||
methods: {},
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
15
tsconfig.json
Normal file
15
tsconfig.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "esnext",
|
||||||
|
"useDefineForClassFields": true,
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"strict": true,
|
||||||
|
"jsx": "preserve",
|
||||||
|
"sourceMap": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"lib": ["esnext", "dom"]
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
|
||||||
|
}
|
@ -1,8 +0,0 @@
|
|||||||
import { defineConfig } from 'vite'
|
|
||||||
import uni from '@dcloudio/vite-plugin-uni'
|
|
||||||
// https://vitejs.dev/config/
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [
|
|
||||||
uni(),
|
|
||||||
],
|
|
||||||
})
|
|
7
vite.config.ts
Normal file
7
vite.config.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { defineConfig } from "vite";
|
||||||
|
import uni from "@dcloudio/vite-plugin-uni";
|
||||||
|
|
||||||
|
// https://vitejs.dev/config/
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [uni()],
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user