多模块重构 12:修改项目名字,按照新的规则

This commit is contained in:
YunaiV
2022-02-02 22:33:39 +08:00
parent 352a67c530
commit 0773a4c4d7
1040 changed files with 12 additions and 190 deletions

View File

@ -0,0 +1,98 @@
// 超出行数自动显示行尾省略号最多5行
// 来自uView的温馨提示当您在控制台看到此报错说明需要在App.vue的style标签加上【lang="scss"】
@for $i from 1 through 5 {
.u-line-#{$i} {
/* #ifdef APP-NVUE */
// nvue下可以直接使用lines属性这是weex特有样式
lines: $i;
text-overflow: ellipsis;
overflow: hidden;
/* #endif */
/* #ifndef APP-NVUE */
// vue下单行和多行显示省略号需要单独处理
@if $i == 1 {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} @else {
display: -webkit-box!important;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
-webkit-line-clamp: $i;
-webkit-box-orient: vertical!important;
}
/* #endif */
}
}
// /* #ifdef APP-NVUE */
// 此处加上!important并非随意乱用而是因为目前*.nvue页面编译到H5时
// App.vue的样式会被uni-app的view元素的自带border属性覆盖导致无效
// 综上这是uni-app的缺陷导致我们为了多端兼容而必须要加上!important
// 移动端兼容性较好直接使用0.5px去实现细边框,不使用伪元素形式实现
.u-border {
border-width: 0.5px!important;
border-color: $u-border-color!important;
border-style: solid;
}
.u-border-top {
border-top-width: 0.5px!important;
border-color: $u-border-color!important;
border-top-style: solid;
}
.u-border-left {
border-left-width: 0.5px!important;
border-color: $u-border-color!important;
border-left-style: solid;
}
.u-border-right {
border-right-width: 0.5px!important;
border-color: $u-border-color!important;
border-right-style: solid;
}
.u-border-bottom {
border-bottom-width: 0.5px!important;
border-color: $u-border-color!important;
border-bottom-style: solid;
}
.u-border-top-bottom {
border-top-width: 0.5px!important;
border-bottom-width: 0.5px!important;
border-color: $u-border-color!important;
border-top-style: solid;
border-bottom-style: solid;
}
// /* #endif */
// 去除button的所有默认样式让其表现跟普通的view、text元素一样
.u-reset-button {
padding: 0;
background-color: transparent;
/* #ifndef APP-PLUS */
font-size: inherit;
line-height: inherit;
color: inherit;
/* #endif */
/* #ifdef APP-NVUE */
border-width: 0;
/* #endif */
}
/* #ifndef APP-NVUE */
.u-reset-button::after {
border: none;
}
/* #endif */
.u-hover-class {
opacity: 0.7;
}

View File

@ -0,0 +1,15 @@
@import "./mixin.scss";
/* #ifndef APP-NVUE */
// 由于uView是基于nvue环境进行开发的此环境中普通元素默认为flex-direction: column;
// 所以在非nvue中需要对元素进行重置为flex-direction: column; 否则可能会表现异常
view, scroll-view, swiper-item {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
/* #endif */

View File

@ -0,0 +1,257 @@
// .u-flex {
// @include vue-flex(row);
// }
// .u-flex-x {
// @include vue-flex(row);
// }
// .u-flex-y {
// @include vue-flex(column);
// }
// .u-flex-xy-center {
// @include vue-flex(row);
// justify-content: center;
// align-items: center;
// }
// .u-flex-x-center {
// @include vue-flex(row);
// justify-content: center;
// }
// .u-flex-y-center {
// @include vue-flex(column);
// justify-content: center;
// }
// flex布局
.u-flex,
.u-felx-row,
.u-flex-x {
@include flex;
}
.u-flex-y,
.u-flex-column {
@include flex('column');
}
.u-flex-x-center {
@include flex;
justify-content: center;
}
.u-flex-xy-center {
@include flex;
justify-content: center;
align-items: center;
}
.u-flex-y-center {
@include flex;
align-items: center;
}
.u-flex-x-left {
@include flex;
}
.u-flex-x-reverse,
.u-flex-row-reverse {
flex-direction: row-reverse;
}
.u-flex-y-reverse,
.u-flex-column-reverse {
flex-direction: column-reverse;
}
/* #ifndef APP-NVUE */
// 此处为vue版本的简写因为nvue不支持同时作用于两个类名的样式写法
// nvue下只能写成class="u-flex-x u-flex-x-reverse的形式"
.u-flex.u-flex-reverse,
.u-flex-row.u-flex-reverse,
.u-flex-x.u-flex-reverse {
flex-direction: row-reverse;
}
.u-flex-column.u-flex-reverse,
.u-flex-y.u-flex-reverse {
flex-direction: column-reverse;
}
// 自动伸缩
.u-flex-fill {
flex: 1 1 auto
}
// 边界自动伸缩
.u-margin-top-auto,
.u-m-t-auto {
margin-top: auto !important
}
.u-margin-right-auto,
.u-m-r-auto {
margin-right: auto !important
}
.u-margin-bottom-auto,
.u-m-b-auto {
margin-bottom: auto !important
}
.u-margin-left-auto,
.u-m-l-auto {
margin-left: auto !important
}
.u-margin-center-auto,
.u-m-c-auto {
margin-left: auto !important;
margin-right: auto !important
}
.u-margin-middle-auto,
.u-m-m-auto {
margin-top: auto !important;
margin-bottom: auto !important
}
/* #endif */
// 换行
.u-flex-wrap {
flex-wrap: wrap;
}
// 反向换行
.u-flex-wrap-reverse {
flex-wrap: wrap-reverse;
}
// 主轴起点对齐
.u-flex-start {
justify-content: flex-start
}
// 主轴中间对齐
.u-flex-center {
justify-content: center
}
// 主轴终点对齐
.u-flex-end {
justify-content: flex-end
}
// 主轴等比间距
.u-flex-between {
justify-content: space-between
}
// 主轴均分间距
.u-flex-around {
justify-content: space-around
}
// 交叉轴起点对齐
.u-flex-items-start {
align-items: flex-start
}
// 交叉轴中间对齐
.u-flex-items-center {
align-items: center
}
// 交叉轴终点对齐
.u-flex-items-end {
align-items: flex-end
}
// 交叉轴第一行文字基线对齐
.u-flex-items-baseline {
align-items: baseline
}
// 交叉轴方向拉伸对齐
.u-flex-items-stretch {
align-items: stretch
}
// 以下属于项目(子元素)的类
// 子元素交叉轴起点对齐
.u-flex-self-start {
align-self: flex-start
}
// 子元素交叉轴居中对齐
.u-flex-self-center {
align-self: center
}
// 子元素交叉轴终点对齐
.u-flex-self-end {
align-self: flex-end
}
// 子元素交叉轴第一行文字基线对齐
.u-flex-self-baseline {
align-self: baseline
}
// 子元素交叉轴方向拉伸对齐
.u-flex-self-stretch {
align-self: stretch
}
// 多轴交叉时的对齐方式
// 起点对齐
.u-flex-content-start {
align-content: flex-start
}
// 居中对齐
.u-flex-content-center {
align-content: center
}
// 终点对齐
.u-flex-content-end {
align-content: flex-end
}
// 两端对齐
.u-flex-content-between {
align-content: space-between
}
// 均分间距
.u-flex-content-around {
align-content: space-around
}
// 全部居中对齐
.u-flex-middle {
justify-content: center;
align-items: center;
align-self: center;
align-content: center
}
// 是否可以放大
.u-flex-grow {
flex-grow: 1
}
// 是否可以缩小
.u-flex-shrink {
flex-shrink: 1
}

View File

@ -0,0 +1,8 @@
// 通过scss的mixin功能把原来需要写4行的css变成一行
// 目的是保持代码干净整洁不至于在nvue下到处都要写display:flex的条件编译
@mixin flex($direction: row) {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: $direction;
}

View File

@ -0,0 +1,27 @@
// 历遍生成4个方向的底部安全区
@each $d in top, right, bottom, left {
.u-safe-area-inset-#{$d} {
padding-#{$d}: 0;
padding-#{$d}: constant(safe-area-inset-#{$d});
padding-#{$d}: env(safe-area-inset-#{$d});
}
}
//提升H5端uni.toast()的层级避免被uView的modal等遮盖
/* #ifdef H5 */
uni-toast {
z-index: 10090;
}
uni-toast .uni-toast {
z-index: 10090;
}
/* #endif */
// 隐藏scroll-view的滚动条
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}