随笔分类 -  Vue

摘要:####查看当前镜像 注:上传npm需要使用 registry.npmjs 镜像, 但是在开发中使用原始镜像很多时候会出现下载第三方库师表的情况。建议:在开发中使用 npm.taobao.org(淘宝)镜像,上传npm时使用 registry.npmjs 镜像 npm get registry ## 阅读全文
posted @ 2022-11-19 22:25 IT_IOS_MAN 阅读(36) 评论(0) 推荐(0) 编辑
摘要:嵌套 点击事件重复 解决方案 DOM <cube-slide> <cube-slide :options="slideOptions" /> </cube-slide> computed slideOptions() { return { click: false, // 将其中一层的 cube-s 阅读全文
posted @ 2022-11-15 10:53 IT_IOS_MAN 阅读(34) 评论(0) 推荐(0) 编辑
摘要:// 数据响应拦截器,统一处理返回的数据逻辑 axios.interceptors.response.use(res => { if (res && res.status == HTTP_STATUS.SUCCESS) { return res.data; } else { ToastToTxt(w 阅读全文
posted @ 2022-11-15 10:52 IT_IOS_MAN 阅读(15) 评论(0) 推荐(0) 编辑
摘要:alias 的声明 在 vue.config.js 文件中,对 alias 进行申明,此申明方式只提供参考 module.exports = { configureWebpack: { //覆盖webpack的配置项 resolve: { //配置别名 alias: { "@": path.reso 阅读全文
posted @ 2022-11-15 09:26 IT_IOS_MAN 阅读(40) 评论(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 阅读(474) 评论(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 阅读(46) 评论(0) 推荐(0) 编辑
摘要:在 Vuex 的使用过程中, 会面临 数据持久化问题,如:用户数据、菜单数据、必要的信息数据等。 遇到问题:改变数据后 F5 刷新页面,数据不改变 使用方式 export default { mounted() { modules.user.userName = "IT_IOS_MAN" } } 解 阅读全文
posted @ 2022-11-15 09:24 IT_IOS_MAN 阅读(55) 评论(0) 推荐(0) 编辑
摘要:数据共享 State 数据仓库 getter 获取数据 Mutation 修改数据(同步) Action 修改数据(异步) 阅读全文
posted @ 2022-11-15 09:24 IT_IOS_MAN 阅读(17) 评论(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 阅读(43) 评论(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 阅读(19) 评论(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 阅读(72) 评论(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 阅读(18) 评论(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 阅读(18) 评论(0) 推荐(0) 编辑
摘要:运行 npm run serve 或 yarn serve 关闭 Mac control+c Windows ctrl+c 阅读全文
posted @ 2022-11-15 09:19 IT_IOS_MAN 阅读(66) 评论(0) 推荐(0) 编辑

more_horiz
keyboard_arrow_up light_mode palette
选择主题
点击右上角即可分享
微信分享提示