ngx-echarts legend点击不置灰 1 html代码<div echarts id="powerline" [options]="option" (chartInit)="onChartInit($event)" (chartLegendSelectChanged)="chartLegendSelectChanged"></div>1 使用chartInit获取到图标的实例onChartInit ($event) { this.echartsInstance = $event;}2 le.
微信小程序报错:Cannot read property ‘forceUpdate’ of undefined uin-app 运行微信开发工具之后,报微信小程序报错:Cannot read property ‘forceUpdate’ of undefined百度之后说是没有给uniapp配置小程序的ID在项目的根目录下有一个manifest.json的文件(如图)将自己的微信的appid填进去,然后重启HBuilder 和微信开发者工具,就可以了...
Support for the experimental syntax ‘decorators-legacy‘ isn‘t currently enabled (52:1) 在react中写装饰器的报的错,解决办法1 先安装npm install customize-cra react-app-rewired @babel/plugin-proposal-decorators --save2 在项目的根目录下新建config-overrides.js文件加入以下代码const { override, addDecoratorsLegacy } = require('customize-cra');module.exports = overr...
[react-router.v4] Uncaught TypeError: Cannot read property ‘location‘ of undefined 使用react-router-dom时报TypeError: Cannot read property 'location' of undefined ,只要这样引入就可以了
angular中动态传入模板-ngTemplateOutlet 在写公共组件的时候可以通过ng-content实现类似vue的slot的效果,但是使用ng-content不能动态的传参,所以在写组件的时候会受到很大的限制,而ngTemplateOutlet可以动态传参ngTemplateOutlet插入ng-template创建的内嵌视图简单例子<div *ngTemplateOutlet="tpl1"></div><ng-template #tpl1> <span>I am span in tem
微信小程序wxParse解析遇到的问题 1 空格解析失效 找到wxDiscode下的strcharacterDiscode的str = str.replace(/ /g,' ');如下替换成str = str.repalce(/ /g,'\xa0');2 换行解析不出来找到wxDiscode下的strMoreDiscode的str = str.replace(/\r/g...
关于Warning: setState(...): Can only update a mounted or mounting component. This usually means you ca 关于Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op.的解决方案关于react中切换路由时报以上错误,实际的原因是因为在组件挂载(m...
margin-top,padding-top的值是百分比时,分别是如何计算的 之前一直以为margin-top和padding-top为百分比时是相对与父级块级元素的高度的,之后在使用的时候发现margin-top为百分比是不太对,百度一下才知道是自己之前的想法是错误的,在这记录一下margin-top和padding-top为百分比时是相对于父元素的width计算的,不管是margin-left/margin-right...
小程序中如何修改picker-view中选中的样式 picker-view中的indicator-class不能修改其选中的文字的样式,但可以修改背景颜色和边框 <picker-view indicator-class="city-picker" value="{{[selectValue]}}" bindchange="bindChange" ></picker-view>//样式...
js 排序算法 1 冒泡排序 最简单的排序算法之一 function sorting(arr){ //冒泡排序 let len = arr.length,temp= 0; for(let i = 0; i < len -1; i++){ for (let j = i+1; j < len-1; j++){ if(arr...
微信小程序开发中text-overflow属性的使用 text-overflow原本是CSS3的一个属性,在微信小程序中也支持。text-overflow文本溢出显示省略号~注:使用text-overflow时,需要设置固定的宽度才起作用,所以该元素必须具有块状元素的属性(款装元素+行内块状元素)1、一行文本溢出显示省略号overflow: hidden;white-space:nowrap; text-overflow: ...
vue中使用elementui的表单的坑 问题1 vue项目的弹窗上的form表单验证,第一次点击新增时正常,第二次新增打开弹窗后由于表单内容为空,出会先这样的情况2 解决这个问题,在执行新增的时候加上this.$refs[formName].resetFields()或者this.$refs[formName].clearValidate();3、刷新界面后第一次点击新增出现这样"Cannot read propert...
axios的get请求传数组时报400 axios的get方法中传数组时会报400错误,传的格式如下其实后端想要的数据格式是这样的解决方案1 安装qs(npm install qs --save)2 然后再请求拦截器中加入如下的代码就行了...
手写简单的发布订阅模式 class SubScrible{ constructor(){ //事件对象,存放订阅对象 this.events = {}; }//订阅事件方法subscribe(type,callback){ if(typeof this.events[type] === 'undefined'){ //一个type可以订阅多个事件 this.eve...
前端常见的加密方式 1 base64加密<!DOCTYPE HTML><html><head><meta charset="utf-8"><title>base64加密</title><script type="text/javascript" src="base64.js"></script><sc...