首页
找靠谱产品
找解决方案
找靠谱公司
找案例
找对的人
专家智库
悬赏任务
SAAS
ToB门户
了解全球最新的ToB事件
论坛
潜水/灌水快乐,沉淀知识,认识更多同行。
ToB圈子
加入IT圈,遇到更多同好之人。
微博
Follow
记录
Doing
博客
Blog
文库
业界最专业的IT文库,上传资料也可以赚钱
下载
分享
Share
排行榜
Ranklist
相册
Album
应用中心
qidao123.com ToB IT社区-企服评测·应用市场
»
论坛
›
软件与程序人生
›
DevOps与敏捷开发
›
primeflex讲授条记20240720, FastAPI+Vue3+PrimeVue前 ...
返回列表
发新帖
primeflex讲授条记20240720, FastAPI+Vue3+PrimeVue前后端分脱离辟
[复制链接]
发表于 2026-2-19 08:11:30
|
显示全部楼层
|
阅读模式
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要
登录
才可以下载或查看,没有账号?
立即注册
×
练习
先实现根本的页面结构:
代码
如下:
<template>
<div class="flex p-3 bg-gray-100 gap-3">
<div class="w-20rem h-12rem bg-indigo-200 flex justify-content-center align-items-center text-white text-5xl">
<input type="number" value="33" class="p-3 text-3xl w-10rem"/>
</div>
<div class="w-20rem h-12rem bg-indigo-200 flex justify-content-center align-items-center text-white text-5xl">+</div>
<div class="w-20rem h-12rem bg-indigo-200 flex justify-content-center align-items-center text-white text-5xl">
<input type="number" value="333" class="p-3 text-3xl w-10rem"/>
</div>
<div class="w-20rem h-12rem bg-indigo-200 flex justify-content-center align-items-center text-white text-5xl">=</div>
<div class="w-20rem h-12rem bg-indigo-200 flex justify-content-center align-items-center text-white text-5xl">366</div>
</div>
</template>
复制
代码
接下来就是添加点击事故:
<script setup>
import axios from "axios";
import {
ref} from "vue";
const message = ref("frontend variable")
axios.get('http://127.0.0.1:8001/')
.then(function (response) {
// 处理成功情况
console.log(response);
message.value = response.data.message
})
.catch(function (error) {
// 处理错误情况
console.log(error);
})
.finally(function () {
// 总是会执行
});
const onCalcClick = () => {
alert("clicked...")
}
</script>
<template>
<div class="flex p-3 bg-gray-100 gap-3">
<div class="w-20rem h-12rem bg-indigo-200 flex justify-content-center align-items-center text-white text-5xl">
<input type="number" value="33" class="p-3 text-3xl w-10rem"/>
</div>
<div class="w-20rem h-12rem bg-indigo-200 flex justify-content-center align-items-center text-white text-5xl">+
</div>
<div class="w-20rem h-12rem bg-indigo-200 flex justify-content-center align-items-center text-white text-5xl">
<input type="number" value="333" class="p-3 text-3xl w-10rem"/>
复制
代码
回复
使用道具
举报
返回列表
浏览过的版块
移动端开发
Java
张裕
+ 我要发帖
登录后关闭弹窗
登录参与点评抽奖 加入IT实名职场社区
去登录
微信订阅号
微信服务号
微信客服(加群)
H5
小程序
快速回复
返回顶部
返回列表