angular学习中bug整理

1.表格行内“…”展示 ellicpase
2.所有展示性的东西都要有“…”的问题! label:form; 展示有很长的时候!
3.填写的东西,都要有校验的问题!如何提示还是问题? 唯一性,长度,字符类型等等
4.行内编辑:确定和取消=>取消的时候,要注意数据还原的!
5.状态判断:0,1,有没有null的情况?
6.button所有样式的统一!Primary和default!Hover,active,focus等
7.所有超链接的样式统一!Link-address:hover,linked,actived等

8.表格的spin在 每次调用接口的时候,true,返回的时候,false!
9.模糊搜索的bug:当你输入较快的时候,执行了两次接口,但是第一次返回比较慢,第二次比较快,所有,使用的还是第一次的数据!这样肯定没起到模糊搜索的作用!
==>使用了next,解决这个问题!

按钮:各种状态
Link-address统一
Icon我也要统一
使用nz-row?或者bootstrap的 ===>nz-row吧

一定要他妈交互效果!怎么展示,怎么 消失?怎么再出来!
Textarea:不可以缩放!自己写死 ! resize:none;
样式的统一:面包屑,table的行高!Table的“…”的显示!基准的颜色(修改的时候可以方便修改!Scss的变量问题)
Cursor:pointer;的类名!统一使用;tac的类,统一使用;

只能是标签名,类名是不生效的!

div:last-of-type{
  color:red;
}
<div class="abc">
  <div class="b">我是bbb</div>
  <div class="c">最有c</div>
</div>
.b:last-child{ } 也是 不行的,因为.b不是最后的元素!
// 多包一层级,这样就不会出问题了!要不然不能直接选中的!
.ant-breadcrumb > nz-breadcrumb-item:last-child{
  .ant-breadcrumb-link{
    font-weight: normal; // 当前导航 字体没有加粗!
    //color:blue;  // 测试样式,当前导航的样式!
    color: rgba(0,0,0,0.65);// 面包屑当前item的样式
  }
}
最后这个样子实现的!
<!--模糊搜索框--> <!--可以使用 nzBlur触发事件,但是已经失焦的情况,点击 是无效的-->
[nzType]="'search'"

<nz-input [(ngModel)]="inputValue" [nzPlaceHolder]="'Basic usage'" (ngModelChange)="_console($event)">

</nz-input>
有ngModel的,都有ngModelChange事件!可以触发的!

input导入文件的时候:
change事件,第二次选择的时候,应该要清空该文件的啊!
that.uploader.queue=[];
一定要让他清空,要不然每次都是第一条的那个!

快速清空console.log的问题,写一个函数,我可以不执行,全局都没有了!迅速删除的问题!


报错: subscriber's name must be a string    =》少了:public  pageName=“abc。。。。”;

删除后分页的问题!如果是非1页的时候,重新执行search函数:
eg:第十页只有一条,删除后,怎么展示?

订阅:


this.state.notifyDataChanged("invite-ent", 1);

this.state.subscribe("invite-ent", this.pageName, function (value) {
  console.log(value);
  that.currentSteps=value; // this报错的!
});

encapsulation:https://blog.csdn.net/jaytalent/article/details/82083070

ViewEncapsulation这个参数的使用!
模块:ng g m pages/cloud-host --routing -d  
模块主组件:ng g c pages/cloud-host -d
第一个组件:ng g c pages/cloud-host/components/overview -d
1.pages.routing中增加自己模块
2.重写cloud-host的routing文件,并在module中引入该routing(并去除之前的routing名字)
3.在模块的主组件html中用router-outlet,否则不跳转的
第二个组件:ng g c pages/cloud-host/components/host-list -d

如果没有这个:encapsulation: ViewEncapsulation.None
文件内部的样式是不会继承公共样式的!!!所以,必须有!

错误:{path: 'overview', component: 'OverviewComponent'}, // 概览
正确:{path:'overview',component:OverviewComponent},// 概览

Echarts如果是动态获取id的话,那么必须延迟一会才能有效,否则报错!!!!!!!!!!!!!!

Ng4中blur事件或者enter事件:http://www.runoob.com/angularjs2/angularjs2-user-input.html

segmentFault 段故障,思否

获取元素(类似$)的方法,在ba-page-list组件中有使用,看一下!

_elementRef: ElementRef

this._elementRef.nativeElement.querySelector()
Component LoginComponent is not part of any NgModule or the module has not been imported into your module.
组件没有在module中引入!
Maximum call stack size exceeded
For example:
'A' module imports (dependent to) 'B' module
'B' module imports (dependent to) 'A' module
内存泄漏
也可能是:模块里没有引入路由导致的!
eg:auth模块,这个模块定义了路由,但是模块没有引入路由,那么内存泄漏
引入了路由,但是没有引入组件,也是报错的:
Component LoginComponent is not part of any NgModule or the module has not been imported into your module.
npm install
npm install ng-zorro-antd --save
npm install --save @ngx-translate/http-loader
npm install moment --save  // 引入:moment,
npm install bootstrap --save
npm install @types/bootstrap --save-dev
npm install --save normalize.css
// 引入:bootstrap和normalize,引入他们的css,那么就生效了!

theme.scss中引入:animate.css(npm install)


npm install animate.css

为了找滚动条的样式:
发现:theme里面:saas》conf好多样式都是公共的!
使用了一些变量

Can’t bind to ‘ngIf’ since it isn’t a known property of ‘div’. (”
https://blog.csdn.net/strong90/article/details/79856265 ==》appModule中引入BrowserModule,然后各个模块也要引入的!==>实际上这个做法是错误的!
Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.

constructor(private fb: FormBuilder,
            private authService: AuthService,
            public nzMsg: NzMessageService,
            public router: Router) {
}
如果,没有用super,那么,必须标明public或者private
如果有super,那么前面不需要有了,但是要有super

“`

input模糊搜索框应该如何展示?下拉加载更多?还是只给十条?
时间问题:前端默认取本地时间,但是跟后端时间有差,这样,查询不到数据!设备日志里面的效果(相差几分钟的)

猜你喜欢

转载自blog.csdn.net/weixin_42995876/article/details/82657353