我的uniapp自定义模板

/ 前端

自定义模板

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<template>
<view class="wrapper">
<view class="container">
<!-- 内容放在这里 -->
</view>
</view>
</template>

<script setup>

</script>

<style scoped>
html {
box-sizing: border-box;
margin: 0;
padding: 0;
}

*,
*::before,
*::after {
box-sizing: inherit;
}

body {
height: 100%;
margin: 0;
}

.wrapper {
width: 100vw;
height: 100vh;
padding: 5rpx;
box-sizing: border-box;
}

.container {
width: 100%;
height: 50%;
}
</style>

上面是我认为比较方便的模板,可以根据需要自行更改

随意一个项目,点击新建页面

选择自定义模板

在当前文件夹新建一个.vue后缀的文件,将自己喜欢的模板粘贴进去,保存即可(文件名即模板名)