<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钩子函数)的文章就 介绍到这了,更多相关内容请继续浏览下面的相关 推荐文章,希望大家都能在 编程的领域有一番成就!
版权声明:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权、违法违规、事实不符,请将相关资料发送至xkadmin@xkablog.com进行投诉反馈,一经查实,立即处理!
转载请注明出处,原文链接:https://www.xkablog.com/qdvuejs/23616.html