init
This commit is contained in:
commit
5485c3b85a
94 files changed
+10131
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import { ref } from "vue";
|
||||
|
||||
let count = 0;
|
||||
|
||||
const useList = () => {
|
||||
const notificationList = ref([]);
|
||||
|
||||
const add = (optionProps) => {
|
||||
notificationList.value.push({ id: count++, ...optionProps });
|
||||
};
|
||||
|
||||
const remove = (id) => {
|
||||
notificationList.value = notificationList.value.filter((item) => item.id !== id);
|
||||
};
|
||||
|
||||
const clear = () => {
|
||||
notificationList.value = [];
|
||||
}
|
||||
|
||||
return { notificationList, add, remove, clear };
|
||||
};
|
||||
|
||||
export default useList;
|
||||
Reference in new issue
Block a user