News
Vue中API接口如何二次封装Axios进行高效开发
1.src目录下新建 utlis文件夹 ->axios.ts 引入axios插件,创建公共服务器IP ,设置请求拦截器和相应拦截器,最后暴露出去 import axios from "axios" export const SERVER_IP = 'http://XXXXX...
Read More
Verified Listings · Professional Advisors · Free Matching
Compare communities by location, care needs and budget, with clear pricing, availability and verified service details.
News
1.src目录下新建 utlis文件夹 ->axios.ts 引入axios插件,创建公共服务器IP ,设置请求拦截器和相应拦截器,最后暴露出去 import axios from "axios" export const SERVER_IP = 'http://XXXXX...
Read More
News
这里写的是一个旋转按钮使用的是elementPlus vue3动态class三目预算:class="isRotated ? 'rotate' : 'reverseRotate'"通过点击事件给变量取反来实现class样切换 HTML <div clas...
Read More
News
vue3支持 css中支持v-bind来绑定动态样式值,例如: <template> <span>123</span> </template> <script setup> let color="#fff" </s...
Read More
News
DOM节点挂载前 onBeforeMount(() => { console.log('DOM节点挂载前'); }) DOM节点挂载后 onMounted(() => { console.log('DOM节点挂载后'); }) 更新前 onBeforeUpdate(...
Read More
News
示例: 点击右侧的字母,滚动到具体的位置,先给右侧的标题绑定点击事件,拿到点击的元素,在通过scrollIntoView方法进行滚动 { behavior: "smooth" }是平滑滚动属性 <div class="aside"> <ul&...
Read More
News
1.首先配置路径信息,已经单独写过一篇了 点击前往 2.引入包文件 import { useRouter } from 'vue-router' 3.定义变量接一下useRouter实例 let router = useRouter() 4.使用router.push() 进行...
Read More
News
1.引入包文件 import { createRouter, createWebHashHistory } from 'vue-router'; 2.引入组件地址,也可以使用懒加载引入 import Home from '../views/Home.vue';//引入模式 3....
Read More
News
子传父:子组件用defineEmits传递 //子组件 <template> <div> <button @click="btn">我的按钮</button> </div> </template> <s...
Read More