随笔

2018-06-12  本文已影响0人  丿Sorry丶

1、/deep/  

2、>>>

.parent >>> .children{ /* ... */ }     css

.parent /deep/ .children{ /* ... */ } 

.parent ::v-deep .children{ /* ... */ } 

  sass

https://vue-loader.vuejs.org/zh/guide/scoped-css.html#%E6%B7%B7%E7%94%A8%E6%9C%AC%E5%9C%B0%E5%92%8C%E5%85%A8%E5%B1%80%E6%A0%B7%E5%BC%8F

3、

4、

input属性 autocomplete="new-password" 可以避免浏览器账号密码自动填充

5、微信小程序裁剪

https://we-plugin.github.io/we-cropper/#/?id=%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98

6、路由拦截无限循环

router.beforeEach((to, from, next) => {

    const isLogin = sessionStorage.getItem('loginData')

    if (isLogin) {

        next()

    } else {

        //next('/error')

        if (to.path === '/error') { //这就是跳出循环的关键

          next()

        } else {

            next('/error')

        }

    }

})

7、图片宽高不一致,裁剪

必须给一个款或高

position: absolute;

top: 50%;

left: 50%;

transform: translate(-50%,-50%);

-webkit-transform: translate(-50%,-50%);

8、vue -- v-cloak解决刷新或者加载出现闪烁(显示变量)

https://blog.csdn.net/bobobocai/article/details/70676951

9、日历组件

https://github.com/zwhGithub/vue-calendar

10、上传文件(支持断点续传)

https://github.com/simple-uploader/vue-uploader

11、另辟蹊径:vue单页面,多路由,前进刷新,后退不刷新

https://segmentfault.com/a/1190000012083511

12、长英文换行

word-break: break-all;

hyphens: auto;

13、===

上一篇 下一篇

猜你喜欢

热点阅读