前端知识整理(待完善)
一.常见问题
1.懒加载,函数节流
1 | var imgs = document.querySelectorAll('img'); |
#####2.前端组件实现:
1.HTML(组件)占位:(组件文件引入到index.html):
写在body中即可:
1
2
3
4
5
6
7
8
9 > <body>
>
> {{template "/erp/collegenew/inc/consult/templeteA.html" .}}
>
> {{template "/erp/collegenew/inc/consult/templeteB.html" .}}
>
> </body>
>
>
>
>
>
2.组件实现:
1
2
3
4
5
6
7
8
9
10
11
12
13 > <templete id="A">
>
> </templete>
>
> <script>
> var templeteA = new Vue({
> el:'#A',
> data:{
> first:'vue是什么?'
> }
> })
> </script>
>
>
>
>
>
3.index.html中组件使用:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 >
> <script>
> var app = new Vue({
> el:'#app',
> data:{
> first:'vue是什么?'
> },
> components: {
> "tabbarA":templeteA,
> "tabbarB":templeteB
> }
> })
> </script>
>
>
>
>
3.webpage原理:
>
4. CDN 与 DNS
5.http 与 https
>