Browse Source

分页到底提示 打包配置

master-xiaowang
mk 2 months ago
parent
commit
5d322138cc
  1. 1
      .gitignore
  2. 13
      src/view/policy/index.vue
  3. 6
      vite.config.ts

1
.gitignore

@ -6,6 +6,7 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
*.zip
node_modules
epmet-apartment-front

13
src/view/policy/index.vue

@ -86,7 +86,7 @@
<script setup lang="ts">
import { ref, reactive, onMounted, onUnmounted } from "vue";
import { gePolicytList, getPolicyInfo } from "@/api/policy";
import { Message } from '@arco-design/web-vue'
// tabList
const tabList = reactive([
{
@ -123,14 +123,14 @@ interface PolicyResponse {
const showDetail = ref(false);
const handleClickTab = (item: any) => {
active.value = item.dictValue;
joinIn.pageNo = 1;
joinIn.pageNum = 1;
joinIn.dictCode = item.dictValue;
list.value = [];
isLoading.value = true;
getList();
};
const joinIn = {
pageNo: 1,
pageNum: 1,
pageSize: 5,
dictCode: active.value,
};
@ -144,7 +144,10 @@ const isLoading = ref(true);
// getList
const getList = async () => {
try {
if (!isLoading.value) return;
if (!isLoading.value) {
Message.info('没有更多了')
return false;
};
//
const res:PolicyResponse = await gePolicytList(joinIn);
list.value = [...list.value, ...res.data];
@ -152,7 +155,7 @@ const getList = async () => {
isLoading.value = false;
return false;
}
joinIn.pageNo++;
joinIn.pageNum++;
} catch (err) {
console.error("获取数据失败:", err);
}

6
vite.config.ts

@ -7,10 +7,12 @@ import { ArcoResolver } from 'unplugin-vue-components/resolvers'
import { vitePluginForArco } from '@arco-plugins/vite-vue'
// https://vitejs.dev/config/
export default defineConfig({
publicDir: 'epmet-apartment-front',
// Vite 配置中没有 outputDir 属性,应使用 build.outDir 来指定输出目录
// 添加基础路径配置
base: '/epmet-apartment-front/',
publicDir: 'epmet-apartment-front',
build: {
outDir: "epmet-apartment-front",
assetsDir: 'static',
target:['edge90','chrome90','firefox90','safari15']
},
plugins: [

Loading…
Cancel
Save