移动端 h5如何生成快捷方式_h5移动端要点记录

1.在input有padding和height,input自身高度是二者之和,需要加上属性-webkit-box-sizing: border-box;

box-sizing: border-box;

这两个属性可以防止计算padding高度为自身高度;

2.在需要一些文字两段对齐时,只有一行的情况下,光是用text-align:justify;是不起作用的(因为它只针对最后一行有效)。

解决方案可以在对于元素上加上一个伪元素

@mixin title_style($fontweight:normal) {
    font-weight: $fontweight;
    line-height: $font_title;
    font-size:$font_title;
    height:  $font_title;
    text-align: justify;
    width: 100%;
    &:after {
        content: " ";
        display: inline-block;
        width: 100%;
    }
}

3.webpack不同域下转发:

proxy: {
"/xhr": {
"target": "http:/www.qitayu/jiekou",
"secure": false, //用于https安全
"changeOrigin": true //用于不同域名
}

4.在使用antd-mobile+ts时,

tsconfig.ts 中,需要把 "module": "es2015",

如果还是有时会报错,设置"esModuleInterop": true

可以参考:

TypeScript 2.7 · TypeScript中文网 · TypeScript--JavaScript的超集

5.ts检查下不支持事件bind(this),代替方案:

<span className={styleName} data-arg={item.id} key={item.id} onClick={this.changePriId} >
                <PrivilegeContainer  {...item} />
            </span>
        });
        return dom
    }

    private changePriId = (event: any) => {
        console.log(event.currentTarget.dataset.arg);
        const id = event.currentTarget.dataset.arg || 0;
        this.props.changePriId(id);
    }

6.Font Boosting问题:字体的显示大小,与在CSS中指定的大小不一致。

2612158874c76acacb48f2e4bb5afca0.png

解决方案:在该元素的class中添加max-height:100% 。

具体可参考:https://github.com/amfe/article/issues/10

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值