随笔分类 -  vue

1
摘要:今天一个项目,在vue打包过程中,出现Unexpected token: punc (,) [./node_modules/@vant/popperjs/dist/index.esm.mjs:69 这样的错误提示依赖包使用了es6,但是未经过babel-loader解析用sourceMap:”sou 阅读全文
posted @ 2023-01-12 17:10 雪莉06 阅读(1275) 评论(1) 推荐(1) 编辑
摘要:provide的使用方法:在父组件中定义provideprovide和data,methods同级provide中返回值是一个对象,相当于将对象中的内容注入到子孙组件子孙组件使用inject: [ 由provide键名组成的数组 ] ,来获取父级组件的方法或者其他属性具体看代码父组件: provid 阅读全文
posted @ 2023-01-10 10:55 雪莉06 阅读(47) 评论(0) 推荐(0) 编辑
摘要:<span v-show="show" @click="getCode" class="getCode">获取验证码</span> <span v-show="!show" class="count">{{count}}s后重新获取</span> data(){ return { show: tru 阅读全文
posted @ 2022-11-25 09:52 雪莉06 阅读(29) 评论(0) 推荐(0) 编辑
摘要:新项目中遇到了登录时点击用户协议,进入协议页面让用户阅读,然后返回登录页面时发现原来填写的手机号验证码全都没有了。 解决方案:使用keep-alive 在vue.app中添加keep-alive标签。<template> <div id="app"> <keep-alive> <router-vie 阅读全文
posted @ 2022-10-01 14:33 雪莉06 阅读(1057) 评论(0) 推荐(0) 编辑
摘要:在 window.addEventListener('scroll', this.handleScroll,true)加了个true 就会成功。 阅读全文
posted @ 2022-08-17 15:45 雪莉06 阅读(724) 评论(0) 推荐(0) 编辑
摘要:1 在本地建一个文件夹 2 按住shift键同时右键,选择进入在此处打开powershell 窗口,就可以进入这个文件的终端 3 在终端里面执行 npm install vue-devtools 完成后,进入该文件下的node_modules 文件,找到 vue-devtools 文件,进入其中,将 阅读全文
posted @ 2022-08-17 15:17 雪莉06 阅读(1362) 评论(1) 推荐(1) 编辑
摘要:在data()定义全局变量data(){ return{ chart: null }} 在使用插件方法中最前面添加if (this.chart != null && this.chart != "" && this.chart != undefined) { this.chart.dispose() 阅读全文
posted @ 2022-06-07 14:23 雪莉06 阅读(214) 评论(0) 推荐(0) 编辑
摘要:谢谢大家,我知道了,可以通过info来获取,dataRef会将没有属性全部展示出来,如下: onSelect = (selectedKeys, info) => { Message.info(selectedKeys); console.log(info); console.log(info.nod 阅读全文
posted @ 2022-05-26 15:54 雪莉06 阅读(1745) 评论(0) 推荐(0) 编辑
摘要:话不多说看问题: 当封装自定义组件时例如(自定义下拉列表)两个相同的组件在多次v-if变化时偶尔会发生渲染错误,明明赋值正确但是组建中的ajax方法可能返回的数据乱掉,或者其他神逻辑错误。 经过查询发现正确的做法,在官网中已经明示: key 预期:number | string key 的特殊属性主 阅读全文
posted @ 2022-05-24 14:22 雪莉06 阅读(71) 评论(0) 推荐(0) 编辑
摘要:npm run dev 错误提示: { parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }. 解决方法: 找到你的工程文件夹里的 YourProName\node_modules\vue-loader\l 阅读全文
posted @ 2022-03-09 14:46 雪莉06 阅读(991) 评论(0) 推荐(0) 编辑
摘要:表格加载 <el-table :data="tableData" row-key="target_id" v-loading="loading" element-loading-text="小主别急" border > async getAllIndicatorNameList() { this.l 阅读全文
posted @ 2021-07-27 16:54 雪莉06 阅读(3893) 评论(0) 推荐(0) 编辑
摘要:在Vue-cli中使用lang="less"时报错:Module build failed: TypeError: this.getOptions is not a function at Object.loader (D:\WORK\VueProject\XiaoWei\node_modules\ 阅读全文
posted @ 2021-06-30 11:27 雪莉06 阅读(3225) 评论(0) 推荐(0) 编辑
摘要:1. v-model 表单输入绑定 使用v-model创建双向数据绑定, 用来监听用户的输入事件以更新数据,并对一些极端场景进行一些特殊处理。 <template> <div> <input class="login-input" type="text" v-model="username" pla 阅读全文
posted @ 2021-06-16 15:05 雪莉06 阅读(1551) 评论(0) 推荐(0) 编辑

1
点击右上角即可分享
微信分享提示