2024.12.9 小bug

2024.12.9 小bug

vue的script后面如果不加setup会导致vue组件绑定不上

image-20241209120842022

加上就好了

<template>
  <div style="height: 100px"></div>
  <form action="/ai" method="post" id="aiForm">
    aaaa
    <input
      v-model="aiMessageInput"
      type="text"
      name="aiMessageInput"
      placeholder="请输入你要提问的问题"
      required
    />
  </form>
  <div>
    <button :onclick="onSubmit">提交</button>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import MyAxios from "@/plugins/myAxios";

const aiMessageInput = ref("");

const onSubmit = async () => {
  const res = await MyAxios.post("/ai", {
    aiMessage: aiMessageInput.value,
  });
  console.log(res);
};

</script>

<style scoped></style>

image-20241209120944291

posted @   vast_joy  阅读(7)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 张高兴的大模型开发实战:(一)使用 Selenium 进行网页爬虫
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示