jmash-diy-mp 0.1.4 → 0.1.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmash-diy-mp",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "private": false,
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <view class="basic-title-main">
3
- <!-- 标题(style=0:原有左侧竖线,style=1:左侧自定义图标) -->
3
+ <!-- 标题(titleStyle=0:原有左侧竖线,titleStyle=1:左侧自定义图标) -->
4
4
  <view class="main-left">
5
5
  <!-- 标题前面竖线 -->
6
- <image wx:if="{{ titleStyle === '0' }}" class="main-left-image"
7
- src="{{ resourceUrl + 'images/icon_image/rectangle2x_' + themeColor + '.png' }}" mode="aspectFit" />
8
6
  <image wx:if="{{ titleStyle === '1' }}" class="title-left-icon" src="{{ resourceUrl + titleImage }}"
9
7
  mode="aspectFit" />
8
+ <image wx:else class="main-left-image"
9
+ src="{{ resourceUrl + 'images/icon_image/rectangle2x_' + themeColor + '.png' }}" mode="aspectFit" />
10
10
  {{ title }}
11
11
  </view>
12
12
  <!-- 查看更多 -->
@@ -56,8 +56,8 @@ createComponent({
56
56
  let resourceUrl = config.resourceUrl + '/';
57
57
  // 主题色
58
58
  let themeColor = ref(props.pageModel.pageData.theme);
59
- // 样式(0:原有左侧竖线,1:自定义图标两侧)
60
- let titleStyle = ref(props.compModel?.compData?.titleStyle ?? "0");
59
+ // 标题样式(titleStyle=0:原有左侧竖线,1:左侧自定义图标)
60
+ let titleStyle = ref(props.compModel?.compData?.titleStyle);
61
61
  // 标题图标
62
62
  let titleImage = ref(props.compModel?.compData?.titleImage ?? "");
63
63
 
@@ -68,7 +68,7 @@ createComponent({
68
68
  });
69
69
  // 监听 titleStyle 变化
70
70
  watch(() => props.compModel?.compData?.titleStyle, (newVal) => {
71
- titleStyle.value = newVal ?? "0";
71
+ titleStyle.value = newVal;
72
72
  });
73
73
  // 监听 titleImage 变化
74
74
  watch(() => props.compModel?.compData?.titleImage, (newVal) => {
@@ -78,6 +78,8 @@ createComponent({
78
78
  return {
79
79
  resourceUrl,
80
80
  themeColor,
81
+ titleStyle,
82
+ titleImage,
81
83
  }
82
84
  },
83
85
  methods: {