Commit 60f70b9c authored by jiaxu.yan's avatar jiaxu.yan

feat: 修改home页面的展示错误

parent 140f5795
import { ref } from "vue";
import http from "@/api/http";
let api = ref("");
let source = ref([]);
let total = ref(0);
const getData = (params = {}) => {
http.get(api.value, params).then((res) => {
source.value = res.data;
console.log(source.value);
});
};
export default {
install(app) {
app.directive("dataSource", {
mounted(el, binding) {
api.value = binding.value;
getData();
},
updated(el, binding) {
console.log("updated");
},
});
},
};
export { source, total, getData };
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment