开发者工具会清空wxss文件
发布于 6 年前 作者 minzhong 13923 次浏览 来自 问答

      - 当前 Bug 的表现(可附上截图)

   

      使用mpvue build出来的wxss文件是有内容的,点击编译按钮,一个wxss文件内容被清空

   

      - 预期表现

   

      点击开发者工具的编译按钮,一个wxss文件变成了空文件

   

      - 复现路径

   

      

   

      - 提供一个最简复现 Demo

   

      右侧的文件是生成的wxss文件,原来是8kb,点击编译变成了0字节,真是见鬼了。文件内容:

   

      

   

      

 

      

经测试,应该是「自动样式补全」的bug,去掉这个选项就可以

@import "/static/css/vendor.wxss";
.session-item{width:702rpx;height:300rpx;margin:34rpx auto 0;box-shadow:0 0 8rpx rgba(0,0,0,.1);border-radius:16rpx;background:#fff;overflow:hidden;position:relative}.session-item .session-mark{color:#fff;font-size:28rpx;display:inline-block;width:220rpx;text-align:center;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);position:absolute;left:-16rpx;top:26rpx;font-weight:300;-webkit-transform-origin:0 100%;transform-origin:0 100%;padding-top:70rpx}.session-item ._h5{padding:0 40rpx 0 136rpx}.session-item ._h5 ._img{width:34rpx;height:34rpx;margin-right:40rpx;position:relative;top:6rpx}.session-item .item-txt1{margin-top:100rpx;color:#4a4a4a;font-size:36rpx;font-weight:600;position:relative}.session-item .item-txt2{margin-top:16rpx;color:#4a4a4a;font-size:24rpx}.session-item .status-txt{color:#ff6b20;font-size:28rpx;display:inline-block;position:absolute;top:38rpx;right:38rpx}.session-item .btn-panel{padding:0 68rpx;position:absolute;left:0;width:100%;bottom:36rpx;height:52rpx;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between}.session-item .btn-panel ._button{min-width:148rpx;height:52rpx;margin:0;font-size:28rpx;text-align:center;border-radius:8rpx;display:inline-block;box-sizing:border-box}.session-item .btn-panel .type1{color:#ff6b20;line-height:48rpx;border:1rpx solid #ff6b20;background:#fff}.session-item .btn-panel .type2{color:#fff;line-height:52rpx;background:#ff6b20}.session-item .btn-panel .type3{color:#fff;line-height:52rpx;background:#dbdbdb}.session-item .mark{display:none;background:rgba(0,0,0,.4)}.session-item .mark,.session-item .mark .blur-bg{width:100%;height:100%;position:absolute;left:0;top:0}.session-item .mark .blur-bg{-webkit-filter:blur(20rpx);filter:blur(20rpx)}.session-item .mark ._h5{text-align:center;font-size:48rpx;color:#fff;width:100%;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);padding:0}.session-item .mark-show{display:block}.tab .tab-item.font-md{color:#666}.tab .tab-item.font-md.active{color:#4a4a4a;font-weight:600}.nothing{font-size:28rpx}.nexLesson{position:relative;background:#fffbf4;border-radius:12rpx;border:2rpx solid #ffd430;padding:80rpx 40rpx;overflow:hidden}.nexLesson .label{position:absolute;color:#fff;top:0;left:0;background:#f5a623;line-height:64rpx;border-radius:0 0 12rpx 0}.nexLesson ._div{margin:0 auto;font-size:28rpx}.nexLesson .title{font-size:36rpx;padding-bottom:24rpx;font-weight:500}._img{width:34rpx;height:34rpx;margin-right:40rpx;position:relative;top:6rpx}scroll-view{height:1000rpx}page{background:#fff}.tab{display:-webkit-flex;display:flex;height:80rpx;-webkit-align-items:center;align-items:center}.tab .tab-item{height:70rpx;position:relative;font-size:32rpx;font-family:PingFangSC-Medium;font-weight:500;color:#4a4a4a;padding:12rpx 0;margin:0 48rpx 0 0;line-height:44rpx}.tab .tab-item.active:after{content:"";width:100%;height:8rpx;left:0;background-color:#ffe275;border-radius:10rpx;position:absolute;bottom:0}.right-mark{display:inline-block;margin:0;border-right:4rpx solid;border-top:4rpx solid;width:16rpx;height:16rpx;-webkit-transform:rotate(45deg);transform:rotate(45deg);position:relative;top:-3rpx}.course-page{padding:0 24rpx;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100vh}.course-page swiper{-webkit-flex:1;flex:1}.course-item{width:98%;height:auto;margin:1%;margin-bottom:30rpx;border-radius:8rpx}.item-t{min-height:180rpx;display:-webkit-flex;display:flex;overflow:hidden;border-radius:8rpx 8rpx 0 0;box-shadow:0 -1rpx 8rpx 2rpx #ddd}.item-t .item-tr{border-left:54rpx solid #4484de;width:648rpx;background:#fff;padding-bottom:30rpx}.item-t .item-tr ._img{width:34rpx;height:34rpx;position:relative;top:8rpx}.item-t .item-tr .item-tr-txt1{padding:38rpx 0 0 38rpx;color:#4a4a4a;font-size:36rpx;font-weight:600}.item-t .item-tr .item-tr-txt2{color:#626262;font-size:28rpx;margin-top:22rpx;padding:0 26rpx 0 30rpx}.item-t .item-tr .item-tr-txt3{text-overflow:ellipsis;overflow:hidden}.item-t .item-tr .item-tr-txt3,.item-t .item-tr .item-tr-txt4{color:#626262;font-size:28rpx;margin-top:6rpx;padding:0 26rpx 0 30rpx;white-space:nowrap}.item-t .item-tr .item-tr-txt4 .span1{border-radius:4rpx 0 0 4rpx}.item-t .item-tr .item-tr-txt4 .span1,.item-t .item-tr .item-tr-txt4 .span2{display:inline-block;padding:0 8rpx;color:#fff;font-size:24rpx;line-height:40rpx}.item-t .item-tr .item-tr-txt4 .span2{-webkit-filter:saturate(160%);filter:saturate(160%);border-radius:0 4rpx 4rpx 0}.item-m{display:-webkit-flex;display:flex;height:40rpx;overflow:hidden}.item-m .item-ml{width:54rpx;background:#4484de;position:relative}.item-m .item-ml:before{content:"";display:inline-block;width:52rpx;height:52rpx;border-radius:50%;position:absolute;background:#fff;box-shadow:inset 0 0 8rpx #ddd;z-index:9;left:-42rpx;top:-6rpx}.item-m .item-mr{-webkit-flex-grow:1;flex-grow:1;background:#fff;position:relative}.item-m .item-mr ._span{display:inline-block;width:100%;height:2rpx;background:#ddd;position:absolute;left:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.item-m .item-mr:before{content:"";display:inline-block;width:52rpx;height:52rpx;box-shadow:inset 0 0 8rpx #ddd;border-radius:50%;position:absolute;background:#fff;z-index:9;right:-42rpx;top:-6rpx}.item-b{min-height:120rpx;display:-webkit-flex;display:flex;overflow:hidden;border-radius:0 0 8rpx 8rpx;box-shadow:0 2rpx 8rpx 2rpx #ddd}.item-b .item-br{border-left:54rpx solid #4484de;-webkit-flex-grow:1;flex-grow:1;background:#fff}.item-b .item-br ._h5{padding:0 28rpx 0 32rpx;height:120rpx;-webkit-align-items:center;align-items:center;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between}.item-b .item-br .item-br-txt1{font-size:28rpx;color:#626262}.item-b .item-br .item-br-txt2{font-size:28rpx;color:#f50}.item-b .item-br .item-br-txt3{display:inline-block;width:170rpx;height:52rpx;line-height:52rpx;font-size:28rpx;color:#fff;background:#ff6b20;text-align:center;border-radius:8rpx;padding:0;margin:0}.item-b .item-br .disable{opacity:.5}.statusBar{background:#ffd430;box-shadow:0 12rpx 24rpx rgba(250,173,20,.12);font-size:28rpx;margin:14px 4rpx;margin-top:20rpx;padding:20rpx 40rpx;border-radius:12rpx}.statusBar,.statusBar .numCon{display:-webkit-flex;display:flex;-webkit-justify-content:space-around;justify-content:space-around;-webkit-align-items:center;align-items:center}.statusBar .numCon{-webkit-flex-direction:column;flex-direction:column}.statusBar .numCon .num{font-size:40rpx;line-height:1.8em}.session-item{width:98%;margin:1% 1% 20rpx}.session-item ._h5{width:80%;margin:0 auto;padding:0 auto!important}.session-item .item-txt1{margin-top:80rpx}.session-item .item-txt2{margin-top:0;overflow:hidden;width:80%;text-overflow:ellipsis;white-space:nowrap}._div{box-sizing:border-box}.access-modal{position:fixed;z-index:9;width:100vw;height:0;left:0;top:0;visibility:hidden}.access-modal-show{visibility:visible}.modal-mask{position:absolute;width:100vw;height:100vh;left:0;top:0;background:rgba(0,0,0,.3)}.modal-content{width:526rpx;height:284rpx;left:50%;top:30vh;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);opacity:0;background:#fff;border-radius:24rpx;padding:0 40rpx;position:relative;transition:all .5s ease-out}.modal-content .content-txt1{color:#f45b36;font-size:36rpx;text-align:center;padding-top:30rpx}.modal-content .content-txt2{color:#767676;font-size:28rpx;text-align:center;margin-top:28rpx}.modal-content .modal-btn{height:80rpx;width:100%;font-size:30rpx;border-top:2rpx solid #dcdcdc;display:-webkit-flex;display:flex;line-height:78rpx;-webkit-justify-content:space-between;justify-content:space-between;padding:0 40rpx;margin-top:44rpx;position:relative}.modal-content .modal-btn .btn-l{color:#767676}.modal-content .modal-btn .btn-r{color:#55bd89}.modal-content .modal-btn:after{position:absolute;content:"";display:inline-block;width:2rpx;height:100%;background:#dcdcdc;top:0;left:50%}.modal-content .niu-png{width:324rpx;position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);top:-333rpx}.modal-content-show{top:53vh;opacity:1}

      

1 回复

ps:prettier之后不会被清空,不知道官方同学能定位不

回到顶部