
前端
海滩超人
只想要深刻,而不是复杂。成为超人,游戏愉快。||微信公众号:codeGreatAgain
展开
-
express 接受axios post请求undefined
一、场景:前端vue.js,后端express ,发送axios post请求 express显示undefined。二、原因分析:MIME类型错误。HTTP协议是传输层协议,请求头规定了一些必要信息,比如这个报文的类型是什么样的类型。规定类型的字段叫做MIME类型字段,也就是Content-Type字段。vue.js和express分别有各自的端口,也就是两个应用。他们都有自己的默认接受的数据类型。axios的默认发送报文的类型是application/json,而express默认接受的原创 2022-05-12 17:03:12 · 1057 阅读 · 0 评论 -
vue3使用模块化的 vueX
一、检查自己项目中是否有vuex,没有的话下载安装。我的目录结构:二、写一个user.js,并导出。三、写入口模块index.js。导入createStore和自己写的模块,刚才我写的是user,然后把自己写模块注入到modules中四、main.js中引入入口index.js,并且使用。主要语句:import store from './store‘app.use(store)import { createApp } from 'vue'import App from './Ap原创 2022-05-03 15:07:07 · 2321 阅读 · 0 评论 -
vue3获取当前页面组件的路由参数信息
1、路由信息const router = createRouter({ routes:[ { path:'/selectTreePage/:action/:subject', name:"selectTreePage", component:()=>import('@/pages/home/SelectTreePage') },...2、目的:想在 SelectTreePage 组件中获取 action和subject的参数3、SelectTr原创 2022-04-29 16:44:09 · 10232 阅读 · 0 评论 -
vue3[Vue warn]: Failed to resolve component: XXX If this is a native custom element, make sure to ex
自定义标签存在,但是没有渲染报错:原因:改正前:<script>import {milldeLayoutInMain} from "../../components/home/main/milldeLayoutInMain"export default { name: 'MainPage', components:{ milldeLayoutInMain }}</script>改正后<script>原创 2022-04-25 17:32:24 · 17853 阅读 · 3 评论