11 2022 档案
摘要:页面 <el-tab-pane label="用户名登录"> <el-form :model="form" label-position="right" label-width="70px" style="max-width: 460px" class="loginForm" :rules="for
阅读全文
摘要:安装 npm install vue3-cookies --save main.js import {createApp} from 'vue' import App from './App.vue' import router from './router' import store from '
阅读全文
摘要:基础 安装 vue add router router/index.js import { createRouter, createWebHistory } from 'vue-router' import HomeView from '../views/HomeView.vue' const ro
阅读全文
摘要:Flex 基本概念: 在 flex 容器中默认存在两条轴,水平主轴(main axis) 和垂直的交叉轴(cross axis),这是默认的设置,当然你可以通过修改使垂直方向变为主轴,水平方向变为交叉轴,这个我们后面再说。 在容器中的每个单元块被称之为 flex item,每个项目占据的主轴空间为
阅读全文
摘要:关于node.js 如果想要更新node.js的版本 1.先查看本机node.js版本: node -v 2.清除node.js的cache: sudo npm cache clean -f 3.安装 n 工具 sudo npm install -g n 4.安装最新版本的node.js sudo
阅读全文
摘要:注意:发送网络请求时,回调函数必须要使用箭头函数。 <script> function f1(name,age){ console.log(name,age); } f1("失败",99); //箭头函数 let f2 = (name,age) =>{ console.log(name,age);
阅读全文
摘要:<script> let info = {name:"s z w",email:"xxxxxxx@xxx.com",addr:"北京"}; let {name,addr} = info; console.log(name); console.log(addr); </script> Vue3中需要什
阅读全文
摘要:<script> function info(v1,...data){ console.log(v1,data); } info(11); info(11,22); info(11,22,333,444,55); </script> <script> function info(v1,v2,v3,v
阅读全文
摘要:let info = "我是" + "?" + "今年技术"; <script> let name = "张开"; let age = 73; let info = `我叫${name},今年${age}岁`; </script>
阅读全文
摘要:var/let/const <script> function show(){ if(1==1){ var name = "szw"; //函数作用域=Python } consolo.log(name); } show(); </script> <script> if(1==1){ let age
阅读全文
摘要:<template> //使用 <span> {{name}}</span> <span> {{age}}</span> </template> <script> import { reactive, ref ,toRefs} from 'vue'; export default { setup()
阅读全文
摘要:基本使用 <template> <el-button type="primary" @click="handle">{{ count }}</el-button> <el-button type="primary" @click="handle1">统计</el-button> </template
阅读全文
摘要:概念 Vue Router 是 Vue.js 的官方路由。它与 Vue.js 核心深度集成,让用 Vue.js 构建单页应用变得轻而易举。功能包括: 嵌套路由映射 动态路由选择 模块化、基于组件的路由配置 路由参数、查询、通配符 展示由 Vue.js 的过渡系统提供的过渡效果 细致的导航控制 自动激
阅读全文
摘要:概念 状态管理器,存取数据用的,可以跨组件通信(屏蔽了组件的父子关系) 定义store //store/index.js import { createStore } from "vuex"; const store = createStore({ state:{ // 存数据的地方 count:0
阅读全文
摘要:前端存数据的地方 -cookie中:借助第三方插件,自己用js写,超时时间+发送请求自动携带。 -sessionStorage:关闭浏览器,它就没了 -localStorage:永久存在,手动删除,或浏览器存满了、 使用:sessionStorage sessionStorage.setItem('
阅读全文
摘要:使用包管理器 npm install element-plus --save 完整引入 // main.js import { createApp } from 'vue' import ElementPlus from 'element-plus' import 'element-plus/dis
阅读全文
摘要:加载<style scoped> 表示写的样式,只在当前组件生效,不会影响到其他组件,造成污染
阅读全文
摘要:概念 mixin 混入:可以把多个组件共用的配置提取成一个混入对象 提取混入对象 export const hunhe={ methods:{ show(){ console.log('show'); } }, data(){ return{ age:12 } } } 注册混入,全局注册(只要注册了
阅读全文
摘要:定义 props是组件间通信,父传子,自定义属性时,子组件间中接收父组件中传入的数据使用的配置项 主 <script> import New from './components/NewComponents.vue' export default{ components:{ New, }, data
阅读全文
摘要:test.js let name1 = 'testName'; function testFunc(){ console.log(name1); } export default { name1, testFunc} 使用 <script> // 导入 import test from '../te
阅读全文
摘要:组件就是 xx.vue <!-- 第二部分 --> <!-- 以后在这个对象中写咱们之前学的data,methods,watch,computed,生命周期钩子 --> <script> export default { data() { return { name: 'szw' } }, prop
阅读全文