Initial project
This commit is contained in:
29
examples/Root.vue
Normal file
29
examples/Root.vue
Normal file
@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<root-layout v-if="isReady" icp="test icp" author="test cr name">
|
||||
<authorize-form class="test" />
|
||||
<textarea v-text="JSON.stringify(userStore.loginUser)"></textarea>
|
||||
<comment :bizType="CommentBizType.ARTICLE" :bizId="1" />
|
||||
</root-layout>
|
||||
<popup />
|
||||
<user-profile-popup />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { CommentBizType, Popup, SettingMapper, userStore } from "timi-web";
|
||||
import { AuthorizeForm, Comment, RootLayout, UserProfilePopup } from "~/components";
|
||||
|
||||
const isReady = ref(false);
|
||||
|
||||
onMounted(async () => {
|
||||
await SettingMapper.loadSetting();
|
||||
await userStore.login4Storage();
|
||||
isReady.value = true;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.test {
|
||||
width: 20rem;
|
||||
margin: 2rem auto;
|
||||
}
|
||||
</style>
|
||||
15
examples/main.ts
Normal file
15
examples/main.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { createApp } from "vue";
|
||||
import Root from "./Root.vue";
|
||||
import TimiWebUI, { axios, Network, VPopup } from "timi-web"; // 本地开发
|
||||
|
||||
import "timi-web/style.css";
|
||||
import "~/assets/style/tencent-cloud.less";
|
||||
import "~/assets/style/tencent-cloud-custom.less";
|
||||
|
||||
axios.defaults.baseURL = "http://localhost:8091";
|
||||
axios.interceptors.request.use(Network.userTokenInterceptors);
|
||||
|
||||
const app = createApp(Root);
|
||||
app.use(TimiWebUI);
|
||||
app.directive("popup", VPopup);
|
||||
app.mount("#root");
|
||||
5
examples/vite-env.d.ts
vendored
Normal file
5
examples/vite-env.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
declare module "*.vue" {
|
||||
import type { DefineComponent } from "vue";
|
||||
const component: DefineComponent<{}, {}, any>;
|
||||
export default component;
|
||||
}
|
||||
Reference in New Issue
Block a user