@lambo-design/pro-layout 1.0.0-beta.72 → 1.0.0-beta.73
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": "@lambo-design/pro-layout",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.73",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "lambo",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"registry": "https://registry.npmjs.org/"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@lambo-design/
|
|
14
|
-
"@lambo-design/
|
|
13
|
+
"@lambo-design/shared": "^1.0.0-beta.43",
|
|
14
|
+
"@lambo-design/core": "^4.7.1-beta.60"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {}
|
|
17
17
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
:parent-item="item">
|
|
11
11
|
</ProLayoutSiderMenuItem>
|
|
12
12
|
<menu-item v-else :key="`menu-${item.children[0].name}`" :name="getNameOrHref(item, true)">
|
|
13
|
-
<Icon :type="isCollected ? 'ios-star' : 'ios-star-outline'" @click="toggleCollect(item)"></Icon>
|
|
13
|
+
<Icon :type="isCollected[item.name] ? 'ios-star' : 'ios-star-outline'" @click="toggleCollect(item)"></Icon>
|
|
14
14
|
<ProLayoutSiderIcon :icon-type="item.meta.icon"></ProLayoutSiderIcon>
|
|
15
15
|
<span>{{ showTitle(item.children[0]) }}</span>
|
|
16
16
|
</menu-item>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
:parent-item="item">
|
|
21
21
|
</ProLayoutSiderMenuItem>
|
|
22
22
|
<menu-item v-else :key="`menu-${item.name}`" :name="getNameOrHref(item)">
|
|
23
|
-
<Icon :type="isCollected ? 'ios-star' : 'ios-star-outline'" @click="toggleCollect(item)"></Icon>
|
|
23
|
+
<Icon :type="isCollected[item.name] ? 'ios-star' : 'ios-star-outline'" @click="toggleCollect(item)"></Icon>
|
|
24
24
|
<ProLayoutSiderIcon :icon-type="item.meta.icon"></ProLayoutSiderIcon>
|
|
25
25
|
<span>{{ showTitle(item) }}</span>
|
|
26
26
|
</menu-item>
|
|
@@ -39,7 +39,7 @@ export default {
|
|
|
39
39
|
mixins: [sider, menuItem],
|
|
40
40
|
data() {
|
|
41
41
|
return {
|
|
42
|
-
isCollected:
|
|
42
|
+
isCollected: {} // 使用对象来记录每个子菜单的收藏状态
|
|
43
43
|
};
|
|
44
44
|
},
|
|
45
45
|
methods: {
|
|
@@ -62,12 +62,12 @@ export default {
|
|
|
62
62
|
|
|
63
63
|
ajax.post(apiUrl, data).then(function(resp) {
|
|
64
64
|
if (resp.data.code == 1) {
|
|
65
|
-
|
|
66
|
-
const message =
|
|
67
|
-
|
|
65
|
+
this.$set(this.isCollected, item.name, !this.isCollected[item.name]);
|
|
66
|
+
const message = this.isCollected[item.name] ? '收藏成功' : '取消收藏成功';
|
|
67
|
+
this.$Message.success(message);
|
|
68
68
|
} else {
|
|
69
|
-
const message =
|
|
70
|
-
|
|
69
|
+
const message = this.isCollected[item.name] ? '取消收藏失败' : '收藏失败';
|
|
70
|
+
this.$Message.error(message + ', 请联系系统管理员');
|
|
71
71
|
}
|
|
72
72
|
}).catch(function(err) {
|
|
73
73
|
console.error("收藏操作失败:", err);
|