zoukankan      html  css  js  c++  java
  • 关于前端平时需要用到的方法(未完成)

    一、this.$forceUpdate();强制刷新

    二,数据重置刷新赋值

     this.dataals = Object.assign({}, this.dataals)
     
     

    2、向下取整的函数
    Math.floor();
    例如:Math.floor( 23.2222222); // 23

    3、向上取整
    Math.ceil();
    例如: Math.ceil(23.333333); // 24

    4、四舍五入
    Math.round();
    例如:Math.round(23.33333); // 23

    5、四舍五入取n位小数,运算后得到的是字符串
    ().toFixed(n); // 取小数点后n位
    例如:(36.36498524).toFixed(3); // 36.365

      <div class="views" @mouseleave="mouselev" :style="{backgroundImage:'url('+styles+')'}">
     
      styles:require('../../../../../../assets/image/icon__biaozhun.png')
     
     if(this.dataitemall.subjectDomainType=='标签'){
            this.styles=require('../../../../../../assets/image/icon__biaoqian.png')
            }else if(this.dataitemall.subjectDomainType=='分析侧资产'){
            this.styles=require('../../../../../../assets/image/icon__fenxi.png')
            }else if(this.dataitemall.subjectDomainType=='交易侧资产'){
            this.styles=require('../../../../../../assets/image/icon__jiaoyi.png')
            }else if(this.dataitemall.subjectDomainType=='数据标准'){
            this.styles=require('../../../../../../assets/image/icon__biaozhun.png')
            }else if(this.dataitemall.subjectDomainType=='数据质量规则'){
            this.styles=require('../../../../../../assets/image/icon__guize.png')
            }
     
     

    /*滚动条样式*/
            .main::-webkit-scrollbar {
                 4px;    
                /*height: 4px;*/
            }
           .main::-webkit-scrollbar-thumb {
               border-radius:10px;
               -webkit-box-shadow:inset 0 0 5px #bfbfbf;
               background:#bfbfbf;
             }
       .main::-webkit-scrollbar-track {
                -webkit-box-shadow: inset 0 0 5px #FAFAFA;
                border-radius: 0;
                background: #FAFAFA;
             }
     
     
     
    //监听浏览器窗口大小改变
      mounted(){
        this.$nextTick(()=>{
          this.heights= document.documentElement.clientHeight - 400
                  window.addEventListener('resize', () => { 
                           //浏览器变化执行动作
                           this.heights= document.documentElement.clientHeight - 400
                  });
              })
    },
     
     
     
     
     
    //获取浏览器版本
     this.$nextTick(()=>{
          if(navigator.userAgent.toLowerCase().match(/chrome/([d.]+)/)[1].substring(0,navigator.userAgent.toLowerCase().match(/chrome/([d.]+)/)[1].indexOf('.'))>=89)
           {
             this.heights=0
           }else{
            this.heights=1
          }
          }) 
    ////////////////基于谷歌版本89版本以上的兼容问题过于垃圾,十分吐槽,但我却毫无办法!!!!
     
     
     
     
     
     

    Vue中解决多个组件引用了同一个对象作为数据时,当一个组件改动了数据对象时,其他对象的数据也会随着同步改动的情况

     this.dataallsCon=JSON.parse(JSON.stringify(this.dataalls));
     
     
     
     
  • 相关阅读:
    接口框架项目示例
    接口框架开发流程总结
    requests库的简单使用
    使用flask创建简单的接口
    session和token
    解决log函数生成重复log的问题
    自定义封装logging参考
    织梦dedecms做的网站首页标题篡改跳转赌博网站解决方案
    织梦网站安全查杀
    织梦重置密码的方法和织梦网站后台登陆账号修改方法
  • 原文地址:https://www.cnblogs.com/hz1124/p/14468047.html
Copyright © 2011-2022 走看看