Skip to content

Commit 3c1412f

Browse files
committed
vue3(NcCollectionList): migrate component to Vue3
Signed-off-by: Maksim Sukharev <[email protected]>
1 parent 100bb3a commit 3c1412f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/components/NcCollectionList/NcCollectionListItem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767

6868
<script>
6969
import { t } from '../../l10n.js'
70-
import { getRoute } from '../NcRichText/autolink.js'
70+
import { getRoute } from '../NcRichText/autolink.ts'
7171

7272
import NcActions from '../NcActions/index.js'
7373
import NcActionButton from '../NcActionButton/index.js'

src/components/NcCollectionList/useCollections.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6-
import { ref, set } from 'vue'
6+
import { ref } from 'vue'
77
import {
88
renameCollectionService,
99
getCollectionsByResourceService,
@@ -21,21 +21,21 @@ export function useCollections() {
2121

2222
// Mutations
2323
const addCollections = (collections) => {
24-
set(storedCollections, 'value', collections)
24+
storedCollections.value = collections
2525
}
2626

2727
const addCollection = (collection) => {
28-
set(storedCollections, 'value', [...storedCollections.value, collection])
28+
storedCollections.value.push(collection)
2929
}
3030

3131
const removeCollection = (collectionId) => {
32-
set(storedCollections, 'value', storedCollections.value.filter(item => item.id !== collectionId))
32+
storedCollections.value = storedCollections.value.filter(item => item.id !== collectionId)
3333
}
3434

3535
const updateCollection = (collection) => {
3636
const index = storedCollections.value.findIndex(item => item.id === collection.id)
3737
if (index !== -1) {
38-
set(storedCollections.value, index, collection)
38+
storedCollections.value[index] = collection
3939
} else {
4040
addCollection(collection)
4141
}

0 commit comments

Comments
 (0)