当前位置:网站首页 > Vue.js开发 > 正文

vue钩子函数是(vue3.0钩子函数)



<script> import {ref, defineComponent, onMounted, onActivated, reactive, toRefs} from "vue"; import CalfIsland from 'https://www.cnblogs.com/li150dan/p/overViewCalfIsland.vue'; export default defineComponent({ components: { CalfIsland }, setup() { const table = ref({ key: "CowId", footer: "Foots", cnName: "在岛犊牛明细", name: "CFCalfIsle", url: "/CFCalfIsle/", sortName: "CowId", }); const editFormFields = ref({}); const editFormOptions = ref([]); const searchFormFields = ref({ CowId: "", SmartCardCode: "", }); const searchFormOptions = ref([ [ { field: "CowId", title: "牛号" }, { field: "SmartCardCode", title: "智能卡片编号" }, ], ]); const columns = ref([ { field: "CowId", title: "牛号", width: 100,sort:true }, { field: "DayAge", title: "日龄", width: 100, sort:true }, { field: "LineName", title: "排名", width: 100, sort: true }, { field: "CalfIsleNumber", title: "列号", width: 100, sort: true }, { field: "CalfIsleCode", title: "犊牛岛编号", width: 100, sort: true }, { field: "SmartCardCode", title: "智能卡片编号", width: 100, sort: true }, ]); const detail = ref({ cnName: "", columns: [], sortName: "", key: "", }); const state = reactive({ search: { PageSize: 30, CurrentPage: 1, OrderField: "CowId", OrderType: "desc", filters: {}, }, }); //组件被激活时执行的函数(每次进去都执行) onActivated(() => { // console.log("刷新");  }); //组件挂载完成后执行的函数(只执行一次) onMounted(() => { // getCowInfoData();  }); return { ...toRefs(state), table, extend, editFormFields, editFormOptions, searchFormFields, searchFormOptions, columns, detail, // getCowInfoData  }; }, }); </script>
到此这篇vue钩子函数是(vue3.0钩子函数)的文章就 介绍到这了,更多相关内容请继续浏览下面的相关 推荐文章,希望大家都能在 编程的领域有一番成就!

版权声明


相关文章:

  • ubuntu源代码阿里云的作用(ubuntu18.04阿里云源)2025-12-03 08:54:06
  • pcie5.0速度(Pcie5.0速度)2025-12-03 08:54:06
  • vue3.0菜鸟教程(vue教程菜鸟教程)2025-12-03 08:54:06
  • pcie5.0显卡能插4.0主板吗(pcie4.0x4插显卡)2025-12-03 08:54:06
  • 合并数组的方法(合并数组js)2025-12-03 08:54:06
  • autohotkey自动登录账号密码(autojs自动登录app代码)2025-12-03 08:54:06
  • vue2(vue2生命周期)2025-12-03 08:54:06
  • vue安装脚手架命令(vue3脚手架安装)2025-12-03 08:54:06
  • js数组方法(js数组方法大全)2025-12-03 08:54:06
  • 报文解析工具V2.3(can报文解析工具)2025-12-03 08:54:06
  • 全屏图片