hy-app 0.3.16 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/components/hy-action-sheet/hy-action-sheet.vue +2 -2
  2. package/components/hy-action-sheet/typing.d.ts +32 -33
  3. package/components/hy-back-top/hy-back-top.vue +36 -32
  4. package/components/hy-button/hy-button.vue +7 -7
  5. package/components/hy-button/typing.d.ts +39 -40
  6. package/components/hy-calendar/index.scss +1 -1
  7. package/components/hy-card/hy-card.vue +3 -3
  8. package/components/hy-cell/hy-cell.vue +125 -118
  9. package/components/hy-cell/index.scss +7 -7
  10. package/components/hy-checkbox/hy-checkbox.vue +17 -16
  11. package/components/hy-checkbox/index.scss +1 -1
  12. package/components/hy-checkbox-item/hy-checkbox-item.vue +25 -30
  13. package/components/hy-checkbox-item/index.scss +1 -1
  14. package/components/hy-code-input/hy-code-input.vue +314 -314
  15. package/components/hy-code-input/index.scss +12 -12
  16. package/components/hy-count-down/index.scss +1 -1
  17. package/components/hy-datetime-picker/index.scss +1 -1
  18. package/components/hy-datetime-picker/typing.d.ts +0 -1
  19. package/components/hy-divider/index.scss +3 -3
  20. package/components/hy-dropdown-item/hy-dropdown-item.vue +2 -2
  21. package/components/hy-dropdown-item/index.scss +5 -5
  22. package/components/hy-float-button/hy-float-button.vue +1 -1
  23. package/components/hy-float-button/index.scss +9 -18
  24. package/components/hy-folding-panel/index.scss +1 -1
  25. package/components/hy-form-item/hy-form-item.vue +10 -11
  26. package/components/hy-grid/hy-grid.vue +23 -23
  27. package/components/hy-grid/index.scss +2 -8
  28. package/components/hy-icon/index.scss +8 -8
  29. package/components/hy-input/hy-input.vue +45 -44
  30. package/components/hy-input/index.scss +12 -11
  31. package/components/hy-line-progress/index.scss +3 -3
  32. package/components/hy-list/hy-list.vue +2 -2
  33. package/components/hy-list/index.scss +4 -4
  34. package/components/hy-loading/hy-loading.vue +2 -3
  35. package/components/hy-loading/index.scss +17 -15
  36. package/components/hy-menu/hy-menu.vue +38 -30
  37. package/components/hy-menu/index.scss +1 -1
  38. package/components/hy-menu/typing.d.ts +16 -12
  39. package/components/hy-modal/hy-modal.vue +11 -11
  40. package/components/hy-modal/index.scss +17 -17
  41. package/components/hy-modal/typing.d.ts +0 -2
  42. package/components/hy-navbar/hy-navbar.vue +3 -3
  43. package/components/hy-navbar/index.scss +10 -11
  44. package/components/hy-notice-bar/hy-column-notice.vue +2 -2
  45. package/components/hy-notice-bar/hy-row-notice.vue +3 -3
  46. package/components/hy-notice-bar/index.scss +9 -12
  47. package/components/hy-notify/hy-notify.vue +8 -5
  48. package/components/hy-notify/index.scss +2 -2
  49. package/components/hy-number-step/index.scss +9 -10
  50. package/components/hy-pagination/index.scss +7 -2
  51. package/components/hy-parse/index.scss +0 -9
  52. package/components/hy-picker/hy-picker.vue +1 -1
  53. package/components/hy-picker/index.scss +9 -16
  54. package/components/hy-popover/hy-popover.vue +6 -4
  55. package/components/hy-popup/hy-popup.vue +4 -2
  56. package/components/hy-popup/index.scss +45 -32
  57. package/components/hy-qrcode/hy-qrcode.vue +3 -3
  58. package/components/hy-qrcode/index.scss +18 -17
  59. package/components/hy-radio/hy-radio.vue +20 -18
  60. package/components/hy-radio/index.scss +26 -22
  61. package/components/hy-rate/hy-rate.vue +5 -5
  62. package/components/hy-rate/index.scss +4 -4
  63. package/components/hy-read-more/hy-read-more.vue +19 -20
  64. package/components/hy-read-more/index.scss +12 -6
  65. package/components/hy-scroll-list/hy-scroll-list.vue +3 -6
  66. package/components/hy-scroll-list/index.scss +4 -4
  67. package/components/hy-search/index.scss +9 -8
  68. package/components/hy-slider/hy-slider.vue +5 -5
  69. package/components/hy-slider/index.scss +12 -12
  70. package/components/hy-status-bar/index.scss +3 -1
  71. package/components/hy-steps/hy-steps.vue +50 -23
  72. package/components/hy-submit-bar/hy-submit-bar.vue +1 -1
  73. package/components/hy-submit-bar/index.scss +5 -4
  74. package/components/hy-subsection/hy-subsection.vue +3 -3
  75. package/components/hy-subsection/index.scss +7 -7
  76. package/components/hy-swipe-action/hy-swipe-action.vue +8 -8
  77. package/components/hy-swipe-action/index.scss +8 -4
  78. package/components/hy-swiper/hy-swiper-indicator.vue +2 -2
  79. package/components/hy-swiper/hy-swiper.vue +6 -6
  80. package/components/hy-swiper/index.scss +6 -10
  81. package/components/hy-switch/hy-switch.vue +4 -4
  82. package/components/hy-switch/index.scss +4 -22
  83. package/components/hy-tabs/hy-tabs.vue +16 -16
  84. package/components/hy-tabs/index.scss +16 -16
  85. package/components/hy-tag/index.scss +1 -1
  86. package/components/hy-text/index.scss +3 -3
  87. package/components/hy-textarea/hy-textarea.vue +11 -11
  88. package/components/hy-textarea/index.scss +11 -10
  89. package/components/hy-toast/hy-toast.vue +5 -5
  90. package/components/hy-toast/index.scss +8 -8
  91. package/components/hy-tooltip/hy-tooltip.vue +193 -183
  92. package/components/hy-tooltip/index.scss +69 -45
  93. package/components/hy-upload/hy-upload.vue +15 -10
  94. package/components/hy-upload/index.scss +37 -36
  95. package/components/hy-warn/hy-warn.vue +11 -11
  96. package/components/hy-warn/index.scss +76 -82
  97. package/components/hy-waterfall/index.scss +2 -1
  98. package/composables/usePopover.ts +2 -2
  99. package/libs/css/mixin.scss +0 -9
  100. package/package.json +2 -2
  101. package/utils/inside.ts +4 -1
  102. package/utils/utils.ts +187 -162
@@ -9,13 +9,13 @@
9
9
  overflow: hidden;
10
10
  border-radius: $hy-border-radius-semicircle;
11
11
 
12
- &__background {
12
+ @include e(background) {
13
13
  background-color: $hy-background--empty;
14
14
  border-radius: $hy-border-radius-semicircle;
15
15
  flex: 1;
16
16
  }
17
17
 
18
- &__line {
18
+ @include e(line) {
19
19
  position: absolute;
20
20
  top: 0;
21
21
  left: 0;
@@ -29,7 +29,7 @@
29
29
  background-color: $hy-primary;
30
30
  }
31
31
 
32
- &__text {
32
+ @include e(text) {
33
33
  font-size: 10px;
34
34
  color: #ffffff;
35
35
  margin-bottom: 1px;
@@ -186,7 +186,7 @@ const instance = getCurrentInstance();
186
186
  onMounted(() => {
187
187
  nextTick(async () => {
188
188
  const res = await getRect(".hy-virtual-container", false, instance);
189
- viewHeight.value = (res as UniApp.NodeInfo).height ?? 0;
189
+ viewHeight.value = (res as UniApp.NodeInfo).height || 0;
190
190
  });
191
191
  });
192
192
 
@@ -257,7 +257,7 @@ watch(
257
257
  * @description 监听滚动条距离顶部距离,实时更新
258
258
  */
259
259
  const onScroll = async (e: any) => {
260
- scrollTop.value = e.detail.scrollTop ?? 0;
260
+ scrollTop.value = e.detail.scrollTop || 0;
261
261
  };
262
262
 
263
263
  /**
@@ -5,16 +5,16 @@
5
5
  padding: 0 $hy-border-margin-padding-base;
6
6
  box-sizing: border-box;
7
7
 
8
- &__list {
8
+ @include e(list) {
9
9
  overflow-anchor: none;
10
- &--item {
10
+ @include m(item) {
11
11
  box-sizing: border-box;
12
12
  }
13
13
 
14
- &--left {
14
+ @include m(left) {
15
15
  margin-right: $hy-border-margin-padding-base;
16
16
  }
17
- &--box {
17
+ @include m(box) {
18
18
  box-sizing: border-box;
19
19
  width: 50%;
20
20
  display: flex;
@@ -2,13 +2,12 @@
2
2
  <view
3
3
  class="hy-loading-icon"
4
4
  :style="customStyle"
5
- :class="[vertical && 'hy-loading-icon--vertical']"
5
+ :class="[vertical && 'hy-loading-icon__vertical']"
6
6
  v-if="show"
7
7
  >
8
8
  <view
9
9
  v-if="!webviewHide"
10
- class="hy-loading-icon__spinner"
11
- :class="[`hy-loading-icon__spinner--${mode}`]"
10
+ :class="['hy-loading-icon__spinner', `hy-loading-icon__spinner--${mode}`]"
12
11
  ref="ani"
13
12
  :style="{
14
13
  color: color,
@@ -8,14 +8,14 @@
8
8
  justify-content: center;
9
9
  color: #c8c9cc;
10
10
 
11
- &__text {
11
+ @include e(text) {
12
12
  margin-left: 4px;
13
13
  color: $hy-text-color--grey;
14
14
  font-size: 14px;
15
15
  line-height: 20px;
16
16
  }
17
17
 
18
- &__spinner {
18
+ @include e(spinner) {
19
19
  width: 30px;
20
20
  height: 30px;
21
21
  position: relative;
@@ -25,19 +25,19 @@
25
25
  max-height: 100%;
26
26
  animation: hy-rotate 1s linear infinite;
27
27
  /* #endif */
28
- }
29
28
 
30
- &__spinner--semicircle {
31
- border: 2px solid transparent;
32
- border-radius: 50%;
33
- }
29
+ @include m(semicircle) {
30
+ border: 2px solid transparent;
31
+ border-radius: 50%;
32
+ }
34
33
 
35
- &__spinner--circle {
36
- border-radius: 50%;
37
- border: 2px solid #e5e5e5;
34
+ @include m(circle) {
35
+ border-radius: 50%;
36
+ border: 2px solid #e5e5e5;
37
+ }
38
38
  }
39
39
 
40
- &--vertical {
40
+ @include m(vertical) {
41
41
  flex-direction: column;
42
42
  }
43
43
  }
@@ -49,20 +49,22 @@
49
49
  }
50
50
 
51
51
  @include b(loading-icon) {
52
- &__spinner--spinner {
53
- animation-timing-function: steps(12);
52
+ @include e(spinner) {
53
+ @include m(spinner) {
54
+ animation-timing-function: steps(12);
55
+ }
54
56
  }
55
57
 
56
58
  &__text:empty {
57
59
  display: none;
58
60
  }
59
61
 
60
- &--vertical &__text {
62
+ @include e(vertical, text) {
61
63
  margin: 6px 0 0;
62
64
  color: $hy-text-color--grey;
63
65
  }
64
66
 
65
- &__dot {
67
+ @include e(dot) {
66
68
  position: absolute;
67
69
  top: 0;
68
70
  left: 0;
@@ -6,26 +6,25 @@
6
6
  :class="menuItemClass(item, i)"
7
7
  :style="customStyle"
8
8
  >
9
- <slot name="icon">
10
- <hy-icon
11
- class="hy-menu-item__icon"
12
- :name="item.icon"
13
- :color="current === i ? color || 'var(--hy-theme-color)' : ''"
14
- :size="icon?.size || 16"
15
- :bold="icon?.bold"
16
- :customPrefix="icon?.customPrefix"
17
- :imgMode="icon?.imgMode"
18
- :width="icon?.width"
19
- :height="icon?.height"
20
- :top="icon?.top"
21
- :stop="icon?.stop"
22
- :round="icon?.round"
23
- :customStyle="icon?.customStyle || { marginRight: '2px' }"
24
- ></hy-icon>
25
- </slot>
26
- <slot>
27
- <text class="hy-menu-item--title">{{ item.title }}</text>
28
- </slot>
9
+ <slot v-if="$slots.icon" name="icon"></slot>
10
+ <hy-icon
11
+ v-else
12
+ class="hy-menu__item__icon"
13
+ :name="item.icon"
14
+ :color="current === i ? color || 'var(--hy-theme-color)' : ''"
15
+ :size="icon?.size || 16"
16
+ :bold="icon?.bold"
17
+ :customPrefix="icon?.customPrefix"
18
+ :imgMode="icon?.imgMode"
19
+ :width="icon?.width"
20
+ :height="icon?.height"
21
+ :top="icon?.top"
22
+ :stop="icon?.stop"
23
+ :round="icon?.round"
24
+ :customStyle="icon?.customStyle || { marginRight: '2px' }"
25
+ ></hy-icon>
26
+ <slot v-if="$slots.default"></slot>
27
+ <text v-else class="hy-menu__item--title">{{ item.title }}</text>
29
28
  <hy-badge
30
29
  :value="item?.badge"
31
30
  :offset="badge?.offset"
@@ -83,6 +82,15 @@ const props = defineProps({
83
82
  type: Array as PropType<Array<MenusType>>,
84
83
  default: [],
85
84
  },
85
+ /** 对应的键 */
86
+ id: {
87
+ type: String,
88
+ default: "id",
89
+ },
90
+ name: {
91
+ type: String,
92
+ default: "id",
93
+ },
86
94
  /** 侧边菜单栏宽度 */
87
95
  width: {
88
96
  type: [String, Number],
@@ -110,23 +118,23 @@ const current = ref<string | number>(0);
110
118
  watch(
111
119
  () => props.modelValue,
112
120
  (newVal) => {
113
- current.value = props.list.findIndex((item) => item.id === newVal);
114
- // current.value = newVal;
121
+ if (newVal) current.value = newVal;
115
122
  },
123
+ { immediate: true },
116
124
  );
117
125
 
118
126
  const menuItemClass = computed(() => {
119
127
  return (temp: MenusType, i: number) => {
120
128
  const classes = [
121
- "hy-menu-item",
122
- prefix.value && "hy-menu-item--prefix",
123
- suffix.value && "hy-menu-item--suffix",
124
- temp.disabled && "hy-menu-item--disabled",
129
+ "hy-menu__item",
130
+ prefix.value && "hy-menu__item--prefix",
131
+ suffix.value && "hy-menu__item--suffix",
132
+ temp.disabled && "hy-menu__item--disabled",
125
133
  ];
126
- if (current.value === i) {
134
+ if (current.value === temp[props.id]) {
127
135
  classes.push(
128
- "hy-menu-item--active",
129
- props.color && "hy-menu-item--active__color",
136
+ "hy-menu__item--active",
137
+ props.color && "hy-menu__item--active__color",
130
138
  );
131
139
  }
132
140
 
@@ -182,7 +190,7 @@ function handleClick(temp: MenusType, i: number) {
182
190
 
183
191
  <style lang="scss" scoped>
184
192
  @import "./index.scss";
185
- .hy-menu-item--active__color {
193
+ .hy-menu__item--active__color {
186
194
  color: v-bind(color);
187
195
  &::before {
188
196
  background: v-bind(color);
@@ -6,7 +6,7 @@
6
6
  max-width: 260rpx;
7
7
  background-color: $hy-background--track;
8
8
 
9
- &-item {
9
+ @include e(item) {
10
10
  display: flex;
11
11
  align-items: center;
12
12
  justify-content: flex-start;
@@ -5,54 +5,58 @@ import type HyIconProps from "../hy-icon/typing";
5
5
  export type ModelValueVo = string | number;
6
6
  export interface MenusType {
7
7
  /**
8
- * @description 唯一id
8
+ * 唯一id
9
9
  * */
10
10
  id: string | number;
11
11
  /**
12
- * @description 标题
12
+ * 标题
13
13
  * */
14
14
  title: string;
15
15
  /**
16
- * @description 是否禁用
16
+ * 是否禁用
17
17
  * */
18
18
  disabled?: boolean;
19
19
  /**
20
- * @description icon
20
+ * icon
21
21
  * */
22
22
  icon?: string;
23
23
  /**
24
- * @description 徽标值
24
+ * 徽标值
25
25
  * */
26
26
  badge?: number;
27
+ /**
28
+ * 键值
29
+ * */
30
+ [key: string]: string | number;
27
31
  }
28
32
 
29
33
  export default interface HyMenuProps {
30
34
  /**
31
- * @description 当前值
35
+ * 当前值
32
36
  * */
33
37
  modelValue: string | number;
34
38
  /**
35
- * @description 菜单数据集
39
+ * 菜单数据集
36
40
  * */
37
41
  list: MenusType[];
38
42
  /**
39
- * @description 侧边菜单栏宽度
43
+ * 侧边菜单栏宽度
40
44
  * */
41
45
  width?: string | number;
42
46
  /**
43
- * @description 选中颜色
47
+ * 选中颜色
44
48
  * */
45
49
  color?: string;
46
50
  /**
47
- * @description 图标属性值
51
+ * 图标属性值
48
52
  * */
49
53
  icon?: Partial<HyIconProps>;
50
54
  /**
51
- * @description 徽标属性值
55
+ * 徽标属性值
52
56
  * */
53
57
  badge?: Partial<HyBadgeProps>;
54
58
  /**
55
- * @description 定义需要用到的外部样式
59
+ * 定义需要用到的外部样式
56
60
  * */
57
61
  customStyle?: CSSProperties;
58
62
  }
@@ -27,13 +27,13 @@
27
27
  }"
28
28
  >
29
29
  <slot>
30
- <text class="hy-modal__content__text">
30
+ <text class="hy-modal__content--text">
31
31
  {{ content }}
32
32
  </text>
33
33
  </slot>
34
34
  </view>
35
35
  <view
36
- class="hy-modal__button-group--confirm-button"
36
+ class="hy-modal__button--group__confirm-button"
37
37
  v-if="$slots.confirmButton"
38
38
  >
39
39
  <slot name="confirmButton"></slot>
@@ -41,26 +41,26 @@
41
41
  <template v-else>
42
42
  <view
43
43
  :class="[
44
- 'hy-modal__button-group',
44
+ 'hy-modal__button--group',
45
45
  showCancelButton &&
46
46
  showConfirmButton &&
47
47
  (!buttonReverse
48
- ? 'hy-modal__button-exact'
49
- : 'hy-modal__button-exact--reverse'),
48
+ ? 'hy-modal__button--exact'
49
+ : 'hy-modal__button--exact--reverse'),
50
50
  ]"
51
51
  :style="{
52
52
  flexDirection: buttonReverse ? 'row-reverse' : 'row',
53
53
  }"
54
54
  >
55
55
  <view
56
- class="hy-modal__button-group__wrapper hy-modal__button-group__wrapper--cancel"
56
+ class="hy-modal__button--group__wrapper first hy-modal__button--group__wrapper--cancel"
57
57
  :hover-stay-time="150"
58
- hover-class="hy-modal__button-group__wrapper--hover"
58
+ hover-class="hy-modal__button--group__wrapper--hover"
59
59
  v-if="showCancelButton"
60
60
  @tap.stop="cancelHandler"
61
61
  >
62
62
  <text
63
- class="hy-modal__button-group__wrapper__text hy-modal__button-group__wrapper--cancel-text"
63
+ class="hy-modal__button--group__wrapper--text hy-modal__button--group__wrapper--cancel__text"
64
64
  :style="{
65
65
  color: cancelColor,
66
66
  }"
@@ -69,16 +69,16 @@
69
69
  </text>
70
70
  </view>
71
71
  <view
72
- class="hy-modal__button-group__wrapper hy-modal__button-group__wrapper--confirm"
72
+ class="hy-modal__button--group__wrapper last hy-modal__button--group__wrapper--confirm"
73
73
  :hover-stay-time="150"
74
- hover-class="hy-modal__button-group__wrapper--hover"
74
+ hover-class="hy-modal__button--group__wrapper--hover"
75
75
  v-if="showConfirmButton"
76
76
  @tap="confirmHandler"
77
77
  >
78
78
  <HyLoading v-if="load" mode="circle"></HyLoading>
79
79
  <text
80
80
  v-else
81
- class="hy-modal__button-group__wrapper__text hy-modal__button-group__wrapper--confirm-text"
81
+ class="hy-modal__button--group__wrapper--text hy-modal__button--group__wrapper--confirm__text"
82
82
  :style="{
83
83
  color: confirmColor,
84
84
  }"
@@ -7,7 +7,7 @@
7
7
  overflow: hidden;
8
8
 
9
9
  /* 标题 */
10
- &__title {
10
+ @include e(title) {
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  justify-content: center;
@@ -20,12 +20,12 @@
20
20
  }
21
21
 
22
22
  /* 内容 */
23
- &__content {
23
+ @include e(content) {
24
24
  padding: 20px;
25
25
  @include flex;
26
26
  justify-content: center;
27
27
 
28
- &__text {
28
+ @include m(text) {
29
29
  font-size: $hy-font-size-sm;
30
30
  color: $hy-text-color--grey;
31
31
  flex: 1;
@@ -34,32 +34,32 @@
34
34
  }
35
35
 
36
36
  /* 底部按钮 */
37
- &__button {
37
+ @include e(button) {
38
38
  /* 两个按钮的样式 */
39
- &-exact {
40
- .hy-modal__button-group__wrapper:first-child {
39
+ @include m(exact) {
40
+ .first {
41
41
  margin-right: $hy-border-margin-padding-lg;
42
42
  }
43
- &--reverse {
44
- .hy-modal__button-group__wrapper:last-child {
43
+ @include m(reverse) {
44
+ .last {
45
45
  margin-right: $hy-border-margin-padding-lg;
46
46
  }
47
47
  }
48
48
  }
49
49
 
50
50
 
51
- &-group {
51
+ @include m(group) {
52
52
  @include flex;
53
53
  padding: 20px;
54
54
 
55
55
  /* 自定义底部按钮 */
56
- &--confirm-button {
56
+ @include e(confirm-button) {
57
57
  flex-direction: column;
58
58
  padding: 0 25px 15px;
59
59
  }
60
60
 
61
61
 
62
- &__wrapper {
62
+ @include e(wrapper) {
63
63
  flex: 1;
64
64
  @include flex;
65
65
  justify-content: center;
@@ -68,28 +68,28 @@
68
68
  border-radius: $hy-border-radius-semicircle;
69
69
 
70
70
  /* 确认 */
71
- &--confirm {
71
+ @include m(confirm) {
72
72
  background-color: $hy-primary;
73
- &-text {
73
+ @include e(text) {
74
74
  color: #FFFFFF;
75
75
  }
76
76
  }
77
77
 
78
78
  /* 取消 */
79
- &--cancel {
79
+ @include m(cancel) {
80
80
  //background-color: $hy-background--empty;
81
81
  background-color: $hy-background--empty;
82
82
 
83
- &-text {
83
+ @include e(text) {
84
84
  color: $hy-text-color;
85
85
  }
86
86
  }
87
87
 
88
- &--hover {
88
+ @include m(hover) {
89
89
  opacity: 0.7;
90
90
  }
91
91
 
92
- &__text {
92
+ @include m(text) {
93
93
  font-size: 16px;
94
94
  text-align: center;
95
95
  }
@@ -1,5 +1,3 @@
1
- import { RowCenterType } from "hy-app/typing/modules/common";
2
-
3
1
  export default interface HyModalProps {
4
2
  /**
5
3
  * @description 是否显示模态框,请赋值给show (默认 false )
@@ -7,7 +7,7 @@
7
7
  height: addUnit(getPx(height) + statusBarHeight),
8
8
  }"
9
9
  ></view>
10
- <view :class="[fixed && 'hy-navbar--fixed']">
10
+ <view :class="[fixed && 'hy-navbar__fixed']">
11
11
  <HyStatusBar v-if="safeAreaInsetTop" :bgColor="bgColor"></HyStatusBar>
12
12
  <view
13
13
  :class="[border && 'hy-border__bottom', 'hy-navbar__content']"
@@ -34,7 +34,7 @@
34
34
  :style="{
35
35
  color: leftIconColor,
36
36
  }"
37
- class="hy-navbar__content__left__text"
37
+ class="hy-navbar__content__left--text"
38
38
  >
39
39
  {{ leftText }}
40
40
  </text>
@@ -75,7 +75,7 @@
75
75
  >
76
76
  <slot name="right">
77
77
  <HyIcon v-if="rightIcon" :name="rightIcon" size="20"></HyIcon>
78
- <text v-if="rightText" class="hy-navbar__content__right__text">{{
78
+ <text v-if="rightText" class="hy-navbar__content__right--text">{{
79
79
  rightText
80
80
  }}</text>
81
81
  </slot>
@@ -11,7 +11,7 @@
11
11
  z-index: 11;
12
12
  }
13
13
 
14
- &__content {
14
+ @include e(content) {
15
15
  @include flex(row);
16
16
  align-items: center;
17
17
  height: 44px;
@@ -19,8 +19,7 @@
19
19
  position: relative;
20
20
  justify-content: center;
21
21
 
22
- &__left,
23
- &__right {
22
+ @include e(left, right) {
24
23
  padding: 0 13px;
25
24
  position: absolute;
26
25
  top: 0;
@@ -29,36 +28,36 @@
29
28
  align-items: center;
30
29
  }
31
30
 
32
- &__left {
31
+ @include e(left){
33
32
  left: 0;
34
33
 
35
- &--hover {
34
+ @include m(hover) {
36
35
  opacity: 0.7;
37
36
  }
38
37
 
39
- &__text {
38
+ @include m(text) {
40
39
  font-size: 15px;
41
40
  margin-left: 3px;
42
41
  }
43
42
  }
44
43
 
45
- &__center {
44
+ @include e(center) {
46
45
  display: flex;
47
46
  flex-direction: column;
48
47
  text-align: center;
49
- &--title {
48
+ @include m(title) {
50
49
  font-size: $hy-font-size-base;
51
50
  }
52
- &--sub {
51
+ @include m(sub) {
53
52
  font-size: $hy-font-size-sm;
54
53
  color: $hy-text-color--grey;
55
54
  }
56
55
  }
57
56
 
58
- &__right {
57
+ @include e(right) {
59
58
  right: 0;
60
59
 
61
- &__text {
60
+ @include m(text) {
62
61
  font-size: 15px;
63
62
  margin-left: 3px;
64
63
  }
@@ -18,10 +18,10 @@
18
18
  <swiper-item
19
19
  v-for="(item, index) in text"
20
20
  :key="index"
21
- class="hy-notice__swiper__item"
21
+ class="hy-notice__swiper--item"
22
22
  :style="{ justifyContent: justifyContent }"
23
23
  >
24
- <text class="hy-notice__swiper__item__text" :style="[textStyle]">{{
24
+ <text class="hy-notice__swiper--item__text" :style="[textStyle]">{{
25
25
  item
26
26
  }}</text>
27
27
  </swiper-item>
@@ -7,8 +7,8 @@
7
7
  </slot>
8
8
  <view class="hy-notice__content" ref="hy-notice__content">
9
9
  <view
10
- ref="hy-notice__content__text"
11
- class="hy-notice__content__text"
10
+ ref="hy-notice__content--text"
11
+ class="hy-notice__content--text"
12
12
  :style="animationStyle"
13
13
  >
14
14
  <text
@@ -74,7 +74,7 @@ watch(
74
74
  // 进行一定的延时
75
75
  await sleep();
76
76
  // 查询盒子和文字的宽度
77
- textWidth = (await getRect(".hy-notice__content__text", false, instance))
77
+ textWidth = (await getRect(".hy-notice__content--text", false, instance))
78
78
  .width;
79
79
  boxWidth = (await getRect(".hy-notice__content", false, instance)).width;
80
80
  // 根据t=s/v(时间=路程/速度),这里为何不需要加上#u-notice-box的宽度,因为中设置了.u-notice-content样式中设置了padding-left: 100%