摘要: 路由 理解: 一个路由(route)就是一组映射关系(key - value),多个路由需要路由器(router)进行管理。 前端路由:key是路径,value是组件。 阅读全文
posted @ 2023-03-24 11:29 垂序葎草 阅读(12) 评论(0) 推荐(0) 编辑
摘要: Count组件视频115 Person组件视频116 7.模块化+命名空间 目的:让代码更好维护,让多种数据分类更加明确。 修改store.js const countAbout = { namespaced:true,//开启命名空间 state:{x:1}, mutations: { ... } 阅读全文
posted @ 2023-03-24 11:08 垂序葎草 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 原题解 ###题目 约束 ###题解 ####方法一:哈希表 class Solution { public: int majorityElement(vector<int>& nums) { unordered_map<int, int> counts; int majority = 0, cnt 阅读全文
posted @ 2023-03-24 03:08 垂序葎草 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 视频 #components ##Count.vue <template> <div> <h1>当前求和为:{{sum}}</h1> <h3>当前求和放大10倍为:{{bigSum}}</h3> <h3>我在{{school}},学习{{subject}}</h3> <h3 style="color 阅读全文
posted @ 2023-03-24 02:40 垂序葎草 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 视频 mapActions方法:用于帮助我们生成与actions对话的方法,即:包含$store.dispatch(xxx)的函数 methods:{ //靠mapActions生成:incrementOdd、incrementWait(对象形式) ...mapActions({incrementO 阅读全文
posted @ 2023-03-24 02:34 垂序葎草 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 视频 6.四个map方法的使用 mapState方法:用于帮助我们映射state中的数据为计算属性 computed: { //借助mapState生成计算属性:sum、school、subject(对象写法) ...mapState({sum:'sum',school:'school',subje 阅读全文
posted @ 2023-03-24 01:33 垂序葎草 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 视频 逻辑复杂且跨组件使用 5.getters的使用 概念:当state中的数据需要经过加工后再使用时,可以使用getters加工。 在store.js中追加getters配置 ...... const getters = { bigSum(state){ return state.sum * 10 阅读全文
posted @ 2023-03-24 01:13 垂序葎草 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 视频 4.基本使用 初始化数据、配置actions、配置mutations,操作文件store.js //引入Vue核心库 import Vue from 'vue' //引入Vuex import Vuex from 'vuex' //引用Vuex Vue.use(Vuex) const acti 阅读全文
posted @ 2023-03-24 00:52 垂序葎草 阅读(42) 评论(0) 推荐(0) 编辑