分类目录归档:Vue3-Dev

[ vscode前端调试 ]


你可以按照以下步骤在 VS Code 中进行前端调试:

在 package.json 里配置好启动脚本(如你的 "dev": "vite")。 在左侧的“运行和调试”视图(或按 ctrl + shift + d)中,点击“创建 launch.json 文件”,选择“Web App (Edge)”或“Web App (Chrome)”。 修改生成的 launch.json,将 url 改为你的本地开发服务器地址(如 http://localhost:5173)。 启动你的开发服务器(如点击 NPM 脚本的“dev”或在终端运行 npm run dev)。 在代码中点击行号左侧设置断点。 在“运行

< Read more >

[ vue3封装axios ]


requiest.js

import axios from "axios";
import { ElMessage } from "element-plus";

const apiService = axios.create();
const NETWORK_ERROR = "网络错误...";

// 请求前
// apiService.interceptors.request.use((config) => {
//     return config;
// }, (error) => {
//     retur

< Read more >

[ Vue3-组件传参-监控 ]


Vue3组件使用, watch监控组件参数

1. 父组件

  • 传给子组件的数据类型为ref
  • 而且前面要写v-model:才是<父组件>-<子组件>数据双向传递

xxx.vue

<template>
    <notebookmain v-model:editor_content="editor_content_ref" v-model:editor_title="editor_title_ref"></notebookmain>
</template>

<script>

< Read more >

[ vue3请求axios使用 ]


Axios基本在Vue3使用

1. 安装

npm install axios

2. 注册

main.js

import { createApp } from 'vue'
import App from './App.vue'
import router from './router.js'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import axios from 'axios'
import './assets/ma

< Read more >

[ Vue3路由route配置 ]


配置Vue3路由模块route

1. 安装

npm install vue-router@4 //不确定名字

2. 配置

  1. 在src目录下创建router.js文件
  2. 在main.js添加注册

router.js

import { createRouter, createWebHistory } from 'vue-router'

export const routes = [
  {
    path: '/',
    name: 'index',
    component: () => import('./views/

< Read more >