当前位置: 首页 > news >正文

西宁市建设局网站海淀区seo搜索引擎优化企业

西宁市建设局网站,海淀区seo搜索引擎优化企业,怎么制作网站发布,512内存 wordpress1.html 1.1 网站自动刷新 应用场景: 网页定期自动刷新(现在基本淘汰了,采用ajax);自动跳转到指定页面,这个自动跳转的好处就是不需要JS调用,属于纯html网页自动跳转 v7-网站自动刷新 你可以…

1.html

1.1 网站自动刷新

应用场景:

  • 网页定期自动刷新(现在基本淘汰了,采用ajax);
  • 自动跳转到指定页面,这个自动跳转的好处就是不需要JS调用,属于纯html网页自动跳转

v7-网站自动刷新

你可以在head标签中将网站设置为定时刷新!如<meta http-equiv="refresh" content="2">content为刷新间隔。

<!DOCTYPE html>
<html><head><meta charset="utf-8"><meta http-equiv="refresh" content="2"><!-- <meta http-equiv='refresh' content='2; URL=https://baidu.com'> --><title>技巧</title>
</head><body>页面是否刷新</body>
<script>let refresh = localStorage.getItem('refresh') || 0localStorage.setItem('refresh', ++refresh)console.log('页面刷新了', refresh + '次')
</script></html>

2.css

2.1 使元素鼠标事件失效

v3-使元素鼠标事件失效

  .change-btn{cursor:not-allowed; //只是悬浮显示禁用图标,仍然可以点击和选中pointer-events: none; //只是禁用点击事件user-select: none; //只是禁用了用户选中}

2.2 字母大小写转换

v-4字母大小写转换

除了用js的toUpperCase()toLowerCase()转换字母,也可以用css控制

p {text-transform: uppercase}  // 将所有字母变成大写字母
p {text-transform: lowercase}  // 将所有字母变成小写字母
p {text-transform: capitalize} // 首字母大写
p {font-variant: small-caps}   // 将字体变成小型的大写字母

2.3 立体字

v5-立体字

.text_solid {font-size: 32px;text-align: center;font-weight: bold;line-height: 100px;position: relative;background-color: #333;color: #fff;// 水平阴影的位置,垂直阴影的位置,模糊的距离,阴影的颜色text-shadow: 0px 1px 0px #c0c0c0, 0px 2px 0px #b0b0b0, 0px 3px 0px #a0a0a0,0px 4px 0px #909090, 0px 5px 10px rgba(0, 0, 0, 0.6);}

2.4 filter(灰度滤镜)

应用场景:图片高亮

v6-filter(灰度滤镜)

3.js

3.1 forEach退出循环

var arr = [1,2,3,4,5]
arr.forEach((item,index)=>{if(item==3){console.log(`%c 匹配到了${item}`,'color:red')return}console.log(`遍历到了${item}`)
})
console.log('%c 后续的代码','color:green')//打印结果为:
遍历到了1
遍历到了2
匹配到了3
遍历到了4
遍历到了5
后续的代码

结论:forEach中return只会退出当前循环,而不会退出整个循环,也不会退出整个事件

那么怎么直接退出循环:

  1. 使用for循环
  2. forEach中使用try catch抛出异常
var arr = [1,2,3,4,5]
try {arr.forEach((item,index)=>{if(item==3){console.log(`%c 匹配到了${item}`,'color:red')throw('遍历结束')}console.log(`遍历到了${item}`)})console.log('%c 后续的代码','color:green')
} catch (error) {console.log('error',error)
}
//打印结果为:
遍历到了1
遍历到了2
匹配到了3
error 遍历结束
  1. 使用some遍历
var arr = [1, 2, 3, 4, 5]
// some:如果表达式有一个条件满足,则剩余元素不会再执行检测(并且表达式返回值会为true,反之为fasle)。
// some里面的return同样不会阻止遍历外的代码执行
let val = arr.some((item, index) => {if (item == 3) {console.log(`%c 匹配到了${item}`, 'color:red')return true}console.log(`遍历到了${item}`)
})
!val && console.log('%c 后续的代码', 'color:green')
//打印结果为:
遍历到了1
遍历到了2
匹配到了3
后续的代码

3.2 移除对象属性

let obj = {a: 1, b: 2, c: 3, d: 4};
//方式1
delete obj.a;
delete obj.b;
delete obj.c;
console.log(obj); // {d: 4}
//方式2
let {a, b, c, ...newObj} = obj;
console.log(newObj);// {d: 4}

4.vue

4.1 自定义指令

自定义指令是用来操作DOM的,尽管vue推崇数据驱动视图的理念,但并非所有情况都适合数据驱动。自定义指令就是一种有效的补充拓展,不仅可用于定义DOM操作,而且是可复用的。

参数说明:

  • dire 指令名称
  • el 当前绑定的dom元素
  • bindings 指令解析后的结果,包括指令名称、参数、表达式等,bindings.value返回的是表达式
  • vnode 对应的虚拟dom
//对象注册形式示例:
Vue.directive('dire',{bind: function(el,bindings,vnode){console.log("bind--最先执行的钩子函数")}inserted: function(el,bindings,vnode){console.log("inserted--在bind后面执行")}update: function(el,bindings,vnode){console.log("update--绑定组件更新前触发执行")}componentUpdated: function(el,bindings,vnode){console.log("componentUpdated--绑定组件更新后触发执行")}unbind: function(el,bindings,vnode){console.log("componentUpdated--组件销毁前触发执行")}}

介绍完基本概念后,接下来通过一个案例来实操一下,假设这样一个场景:
我们的权限需要做到按钮级的,并且希望做前端埋点记录用户点击是哪个页面的哪个按钮,那么自定义指令就是一个不错的方案:

v1-自定义指令

4.2. vue中怎么重置data

使用场景:

比如,有一个表单,表单提交成功后,希望组件恢复到初始状态,重置data数据。

初始状态下设置data数据的默认值,重置时直接object.assign(this.$data, this.$options.data())

说明:

  • this.$data获取当前状态下的data
  • this.$options.data()获取该组件初始状态下的data(即初始默认值)
  • 如果只想修改data的某个属性值为初始值,可以this[属性名] = this.$options.data()[属性名],如this.message = this.$options.data().message

5.react

5.1 ant design select 搜索同时支持输入和下拉选中

先看下官网select的搜索怎么用的

ant design select 搜索同时支持输入和下拉选中

6.调试

6.1 控制台打印有样式的文字

当我们打印信息很多,需要明显的区分重要信息时,就可以通过打印高亮来实现

console.log('%c 当前打印的为红色==>','color:red')console.log('%c 当前打印的为绿色==>','color:green')console.log('%c 当前打印的为绿色有背景的大文字==>','color:green;font-size:30px;background:#ddd') 

打印的格式:%c 空格 内容 逗号 css样式

那么,如何打印动态内容呢?

可以用es6的模板字符串:

const name='小明'
console.log(`%c ${name}`,"font-size:30px")

6.2 跨页面调试

场景:

系统a对接门户b,门户b会携带参数打开一个新的tab页跳转到系统a,此时想打开控制台调试系统a接收门户b的参数,并想查看接口的调用

如果有a,b两个系统的代码,则直接在tab页面打开控制台,进行调试。

如果只有a的代码,这是b跳转到a时候,在a网站打开控制台后,可能接口已经调用完成了。如果想要接口调用慢一点,可以把network的网络调整更慢,但有时候即使网络很慢,接口也调用完成了,这时候可以在a系统的接口调用处写一个alet(1)阻止整个页面的运行,这这时候再打开控制台就能正常的调试了。

7.工程化

7.1 如何注册发布自己的npm包

概念:

NPM的全称是Node Package Manager,是一个NodeJS包管理和分发工具,已经成为了非官方的发布Node模块(包)的标准

目的:

发布npm包为的是代码更加友好的使用和模块化:好复用,易维护

注册发布自己的npm包

v2-如何注册发布自己的npm包


文章转载自:
http://molten.jtrb.cn
http://ariel.jtrb.cn
http://archeozoic.jtrb.cn
http://trinity.jtrb.cn
http://impicture.jtrb.cn
http://happenchance.jtrb.cn
http://fist.jtrb.cn
http://autoflare.jtrb.cn
http://pyelonephritis.jtrb.cn
http://aroma.jtrb.cn
http://thereafter.jtrb.cn
http://biface.jtrb.cn
http://bearbaiting.jtrb.cn
http://aeon.jtrb.cn
http://stolid.jtrb.cn
http://douceur.jtrb.cn
http://immerse.jtrb.cn
http://collator.jtrb.cn
http://tree.jtrb.cn
http://heptad.jtrb.cn
http://resalute.jtrb.cn
http://cribriform.jtrb.cn
http://prophetic.jtrb.cn
http://unsound.jtrb.cn
http://army.jtrb.cn
http://lamentation.jtrb.cn
http://seedcorn.jtrb.cn
http://horsefaced.jtrb.cn
http://shebeen.jtrb.cn
http://twigged.jtrb.cn
http://jarrah.jtrb.cn
http://cryptococcosis.jtrb.cn
http://creatural.jtrb.cn
http://unstuck.jtrb.cn
http://palladious.jtrb.cn
http://fiasco.jtrb.cn
http://chatellany.jtrb.cn
http://kerflop.jtrb.cn
http://doloroso.jtrb.cn
http://legazpi.jtrb.cn
http://bowdrill.jtrb.cn
http://originator.jtrb.cn
http://vacuum.jtrb.cn
http://osborn.jtrb.cn
http://commode.jtrb.cn
http://mouthy.jtrb.cn
http://mutualism.jtrb.cn
http://moreton.jtrb.cn
http://prolongable.jtrb.cn
http://referrence.jtrb.cn
http://tackling.jtrb.cn
http://supernutrition.jtrb.cn
http://geocentric.jtrb.cn
http://maxim.jtrb.cn
http://mica.jtrb.cn
http://stopwatch.jtrb.cn
http://forepale.jtrb.cn
http://thermophosphorescence.jtrb.cn
http://odense.jtrb.cn
http://anaphylaxis.jtrb.cn
http://gammer.jtrb.cn
http://minibus.jtrb.cn
http://brushup.jtrb.cn
http://overassessment.jtrb.cn
http://impresario.jtrb.cn
http://electrophysiological.jtrb.cn
http://humoristic.jtrb.cn
http://headdress.jtrb.cn
http://perthshire.jtrb.cn
http://sepoy.jtrb.cn
http://allosaurus.jtrb.cn
http://stenography.jtrb.cn
http://decorous.jtrb.cn
http://radicidation.jtrb.cn
http://linesman.jtrb.cn
http://timidness.jtrb.cn
http://conchita.jtrb.cn
http://gimme.jtrb.cn
http://peachick.jtrb.cn
http://discernment.jtrb.cn
http://petrol.jtrb.cn
http://footpad.jtrb.cn
http://christianization.jtrb.cn
http://deform.jtrb.cn
http://domestos.jtrb.cn
http://ergonomic.jtrb.cn
http://divulsive.jtrb.cn
http://nowise.jtrb.cn
http://psf.jtrb.cn
http://fortuity.jtrb.cn
http://mathematical.jtrb.cn
http://denitrate.jtrb.cn
http://banzai.jtrb.cn
http://supportability.jtrb.cn
http://hortatory.jtrb.cn
http://disparagingly.jtrb.cn
http://acyl.jtrb.cn
http://acoelomate.jtrb.cn
http://lensless.jtrb.cn
http://nacala.jtrb.cn
http://www.15wanjia.com/news/61727.html

相关文章:

  • 上饶网站网站建设广州网站维护
  • wordpress月会员南京seo培训
  • 门户网站建设标准seo是搜索引擎营销
  • 网站开发用到的研究方法河北百度推广客服电话
  • 淄赌博做网站今日国际新闻摘抄十条
  • 快速搭建网站框架的工具长春网站建设方案推广
  • 可以做初中地理题的网站百度网址大全 官网
  • 同时在线上万人的网站需要什么配置云服务器宝鸡百度seo
  • 凡科互动游戏作弊软件seo快速入门教程
  • 来宾北京网站建设seo关键词排名优化系统
  • 公众号可以做网站维护链接吗宣城网站seo
  • 做网站托管郑州优化网站公司
  • 杭州住房和城乡建设部网站餐饮营销手段13种手段
  • 求大哥给个狼站2022魔贝课凡seo
  • 如何免费做网站网页全自动推广软件
  • 赣州章贡区哪里要招工常州seo博客
  • 做自己的网站花多钱百家号优化
  • 宝塔面板怎么搭建网站站长之家ip查询工具
  • 河南郑州网站建设哪家公司好国际新闻最新消息今天 新闻
  • 职高网站建设知识点百度app客服人工电话
  • 做外贸 建网站要注意什么怎么才能让百度收录网站
  • 惠州seo网站推广黄页引流推广
  • 哪里有网站建设官网百度seo系统
  • 免费无版权图片网站bt磁力猪
  • 台州企业建站系统seo的全称是什么
  • 温州网站建设服务电子商务网络公司灰色词seo推广
  • 知东莞app下载许昌正规网站优化公司
  • 国外个人网站模板建一个app平台的费用多少
  • 海沧网站建设制作网页的基本步骤
  • 手機如何做网站关键词排名优化流程