refactor(about): 统一按钮样式并移除未使用的上传组件

- 将按钮样式统一为 primary/default 和 mini 尺寸
- 删除未使用的上传组件及相关代码
This commit is contained in:
feige996
2025-07-16 21:09:45 +08:00
parent b611dcc8a5
commit 614aadc285
3 changed files with 7 additions and 45 deletions

View File

@@ -9,7 +9,6 @@
<script lang="ts" setup>
import RequestComp from './components/request.vue'
import UploadComp from './components/upload.vue'
// 奇怪:同样的代码放在 vue 里面不会校验到错误,放在 .ts 文件里面会校验到错误
// const testOxlint = (name: string) => {
@@ -34,10 +33,11 @@ function gotoAlova() {
</text>
</view>
<RequestComp />
<UploadComp />
<button class="w-200px text-green" @click="gotoAlova">
前往 alova 页面
</button>
<view class="text-center">
<button type="primary" size="mini" class="w-160px" @click="gotoAlova">
前往 alova 页面
</button>
</view>
</view>
</template>

View File

@@ -25,7 +25,7 @@ function reset() {
<template>
<view class="p-6 text-center">
<button class="my-6 w-200px text-green" @click="send">
<button type="primary" size="mini" class="my-6 w-160px" @click="send">
发送请求
</button>
<view class="h-16">
@@ -45,7 +45,7 @@ function reset() {
{{ data?.id }}
</view>
</view>
<button class="my-6 w-200px text-red" :disabled="!data" @click="reset">
<button type="default" size="mini" class="my-6 w-160px" @click="reset">
重置数据
</button>
</view>

View File

@@ -1,38 +0,0 @@
<route lang="jsonc" type="page">
{
"layout": "default",
"style": {
"navigationBarTitleText": "上传-状态一体化"
}
}
</route>
<script lang="ts" setup>
const { loading, data, run } = useUpload()
</script>
<template>
<view class="p-4 text-center">
<wd-button @click="run">
选择图片并上传
</wd-button>
<view v-if="loading" class="h-10 text-blue">
上传...
</view>
<template v-else>
<view class="m-2">
上传后返回的接口数据
</view>
<view class="m-2">
{{ data }}
</view>
<view v-if="data" class="h-80 w-full">
<image :src="data.url" mode="scaleToFill" />
</view>
</template>
</view>
</template>
<style lang="scss" scoped>
//
</style>