ZBLOG

KeyInfodata Aaab,_* 无结果 Demo

看起来你在编写一个 Vue 3 的组件,包含了一个表单和一些基本的交互功能。以下是修正并补充完整的代码示例:

  1. <template>
  2. <div class="ImageData">
  3. <div class="page-form-area">
  4. <a-form :model="formState" name="time related controls">
  5. KeyInfodata
  6. Aaab,_* 无结果
  7. <a-row>
  8. <a-col :span="8">
  9. <a-form-item label="借据编号">
  10. <a-select v-model="formState.loanId">
  11. <a-select-option value="demo">Demo</a-select-option>
  12. </a-select>
  13. </a-form-item>
  14. </a-col>
  15. <a-col :span="8">
  16. <a-form-item style="margin-left: 40px">
  17. <a-button
  18. class="margin-right-10"
  19. type="primary"
  20. @click.prevent="queryTable"
  21. >
  22. 查询
  23. </a-button>
  24. <a-button @click.prevent="reset">重置</a-button>
  25. </a-form-item>
  26. </a-col>
  27. </a-row>
  28. </a-form>
  29. </div>
  30. </div>
  31. </template>
  32. <script setup>
  33. import { ref, reactive } from 'vue';
  34. import { getLoanList } from '../../utils';
  35. const formState = reactive({
  36. loanId: ''
  37. });
  38. const data = ref([]);
  39. const Contractdata = ref([]);
  40. const params = { custId: '40062' };
  41. const queryTable = async () => {
  42. try {
  43. const response = await getLoanList(params);
  44. console.log(response);
  45. // 假设你需要更新某个数据状态,可以将其赋值给 `data`
  46. data.value = response.data; // 根据实际返回的数据结构调整
  47. } catch (error) {
  48. console.error('请求失败:', error);
  49. }
  50. };
  51. const reset = () => {
  52. formState.loanId = ''; // 重置表单状态
  53. };
  54. </script>
  55. <style scoped>
  56. // 在这里添加样式
  57. </style>

修改和补充内容说明:

  1. Form State:我添加了 formState 对象,用于存储表单数据。
  2. 方法完善:定义了 queryTablereset 方法,并做了必要的处理。
  3. 按钮事件:使用 .prevent 修饰符来阻止默认提交行为。
  4. 样式区域:增加了样式区域,你可以在这里添加相关的 CSS 样式。

确保根据你的实际情况对返回的数据结构进行适当的调整。如果有其他特定需求,请随时告诉我!


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=19509

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?