摘要: alias 的声明 在 vue.config.js 文件中,对 alias 进行申明,此申明方式只提供参考 module.exports = { configureWebpack: { //覆盖webpack的配置项 resolve: { //配置别名 alias: { "@": path.reso 阅读全文
posted @ 2022-11-15 09:26 IT_IOS_MAN 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 例 : _list 是一个数组 var _list : Array for 循环一个数组 _list.forEach(function(value, index) { }); 箭头语法 _list.forEach((value, index) => { }); 阅读全文
posted @ 2022-11-15 09:25 IT_IOS_MAN 阅读(467) 评论(0) 推荐(0) 编辑
摘要: ###使用 const store = new Vuex.Store({ modules: { user: {}, }, getters, actions, // 异步 mutations, // 同步 plugins: [createPersistedState({ // storage:wind 阅读全文
posted @ 2022-11-15 09:25 IT_IOS_MAN 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 在 Vuex 的使用过程中, 会面临 数据持久化问题,如:用户数据、菜单数据、必要的信息数据等。 遇到问题:改变数据后 F5 刷新页面,数据不改变 使用方式 export default { mounted() { modules.user.userName = "IT_IOS_MAN" } } 解 阅读全文
posted @ 2022-11-15 09:24 IT_IOS_MAN 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 数据共享 State 数据仓库 getter 获取数据 Mutation 修改数据(同步) Action 修改数据(异步) 阅读全文
posted @ 2022-11-15 09:24 IT_IOS_MAN 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 子组件 <template> <div> </div> </template> <script> export default { methods: { childEvent(_value) { alert("我是子组件方法" + _value); } } }; </script> 父组件 <tem 阅读全文
posted @ 2022-11-15 09:24 IT_IOS_MAN 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 子组件 <template> <div> </div> </template> <script> export default { methods: { childEvent() { alert("我是子组件方法"); } } }; </script> 父组件 <template> <div> <c 阅读全文
posted @ 2022-11-15 09:23 IT_IOS_MAN 阅读(16) 评论(0) 推荐(0) 编辑
摘要: ###子组件 <template> <div> <button @click="childEvent(_obj)">点击调父组件方法</button> </div> </template> <script> export default { methods: { // _obj 为参数 childE 阅读全文
posted @ 2022-11-15 09:22 IT_IOS_MAN 阅读(68) 评论(0) 推荐(0) 编辑
摘要: ###子组件 <template> <div> <button @click="childEvent()">点击调父组件方法</button> </div> </template> <script> export default { methods: { childEvent() { this.$e 阅读全文
posted @ 2022-11-15 09:21 IT_IOS_MAN 阅读(17) 评论(0) 推荐(0) 编辑
摘要: cd 至项目文件根目录 npm install 用 npm 安装有可能会到导致关联失败 解决方案 yarn install 安装 yarn yarn 安装第三方库比npm 会快一些 npm install yarn -g 如果Mac环境下安装出错, 注意观察错误信息 the command agai 阅读全文
posted @ 2022-11-15 09:20 IT_IOS_MAN 阅读(16) 评论(0) 推荐(0) 编辑