stellar-ui-plus 1.18.1 → 1.18.2

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.
@@ -46,7 +46,7 @@ const cmpText = computed(() => {
46
46
  </script>
47
47
 
48
48
  <template>
49
- <view class="ste-loading-root" :style="[cmpStyle]">
49
+ <view class="ste-loading-root" :style="[cmpStyle]" data-test="loading">
50
50
  <view :class="'loading ' + 'loading-type-' + type" :style="[cmpLoadinStyle]">
51
51
  <block v-if="type == 1">
52
52
  <i v-for="(item, index) in cmpCount" :key="index" class="i" :style="{ transform: `rotate(${item * 40 + 80}deg)`, opacity: item == 0 ? 1 : (item + 1) / 10 }"></i>
@@ -36,7 +36,6 @@ const cmpCount = computed(() => {
36
36
 
37
37
  const cmpActiveCode = computed(() => {
38
38
  let code = getIconCode();
39
- console.log('code', code);
40
39
  if (code) return code;
41
40
  return props.activeCode;
42
41
  });
@@ -53,7 +52,6 @@ let cmpActiveColor = computed(() => {
53
52
 
54
53
  // 根据iconData来算出每个分值对应的iconCode
55
54
  function getIconCode() {
56
- console.log('props.iconData', props.iconData);
57
55
  if (!props.iconData || props.iconData.length === 0) return;
58
56
 
59
57
  let curScroeIndex = Math.ceil(props.modelValue / props.score) - 1;
@@ -1,4 +1,5 @@
1
1
  <script setup lang="ts">
2
+ import { ref } from 'vue';
2
3
  import utils from '../../utils/utils';
3
4
  import propsData from './props';
4
5
 
@@ -9,6 +10,7 @@ const replaceVerticalAlign = (text: string) => {
9
10
  html = utils.richTextTagAddStyle(html, 'p', ['margin', 'margin-top'], ';margin-top:0');
10
11
  html = utils.richTextTagAddStyle(html, 'p', ['margin', 'margin-bottom'], ';margin-bottom:0');
11
12
  html = utils.richTextTagAddStyle(html, 'img', 'vertical-align', ';vertical-align:top');
13
+
12
14
  // 解决微信小程序会忽略空白换行的问题
13
15
  html = html.replace(/↵/g, '\n');
14
16
  html = html.replace(/&nbsp;/g, '\n');
@@ -17,10 +19,18 @@ const replaceVerticalAlign = (text: string) => {
17
19
  html = html.replace(/&mdash;/g, '—');
18
20
  return html;
19
21
  };
22
+
23
+ let env: any = ref(process.env.NODE_ENV);
20
24
  </script>
21
25
  <template>
22
- <view class="rich-text-root">
23
- <rich-text :nodes="replaceVerticalAlign(text)" :user-select="userSelect" class="rich-text" :space="space"></rich-text>
26
+ <view class="rich-text-root" data-test="rich-text">
27
+ <!--测试环境使用-->
28
+ <view v-if="env == 'test'">
29
+ <view class="rich-text" :nodes="replaceVerticalAlign(text)"></view>
30
+ </view>
31
+ <view v-else>
32
+ <rich-text :nodes="replaceVerticalAlign(text)" :user-select="userSelect" class="rich-text" :space="space"></rich-text>
33
+ </view>
24
34
  </view>
25
35
  </template>
26
36
  <style scoped lang="scss">
@@ -11,6 +11,7 @@ defineOptions({
11
11
  const props = defineProps(propsData);
12
12
 
13
13
  const cmpStyle = computed(() => {
14
+ console.log('props', props);
14
15
  let style: CSSProperties = {};
15
16
  style['width'] = utils.formatPx(Number(props.size) * 2 + 4);
16
17
  style['height'] = utils.formatPx(Number(props.size) + 4);
@@ -70,7 +71,7 @@ function allowStop() {
70
71
  </script>
71
72
 
72
73
  <template>
73
- <view class="ste-switch-root" :style="[cmpStyle]" @click="click">
74
+ <view class="ste-switch-root" :style="[cmpStyle]" @click="click" data-test="switch">
74
75
  <view class="switch-node" :style="[cmpNodeStyle]">
75
76
  <ste-loading v-if="loading" :type="2" :color="modelValue ? cmpActiveColor : inactiveColor" :size="Number(size) / 2"></ste-loading>
76
77
  </view>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stellar-ui-plus",
3
- "version": "1.18.1",
3
+ "version": "1.18.2",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "MIT",
package/utils/System.ts CHANGED
@@ -43,7 +43,7 @@ export default class System {
43
43
  */
44
44
  static getWindowInfo() {
45
45
  // 测试环境判断
46
- if (process.env.NODE_ENV == 'test') {
46
+ if (process.env.NODE_ENV == 'test' || process.env.UNI_APP_NAME == 'stellar-debug') {
47
47
  let windowInfo = {
48
48
  pixelRatio: 3,
49
49
  safeArea: {