新增前端vue
This commit is contained in:
@@ -35,24 +35,33 @@
|
||||
setup() {
|
||||
const { prefixCls } = useDesign('header-notify');
|
||||
const { createMessage } = useMessage();
|
||||
const listData = ref<TabItem[]>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
const response = await tabListDataAll();
|
||||
listData.value = response;
|
||||
});
|
||||
|
||||
const count = computed(() => {
|
||||
let count = 0;
|
||||
for (let i = 0; i < listData.value.length; i++) {
|
||||
count += listData.value[i].list.length;
|
||||
const listData = ref<TabItem[]>([]);
|
||||
|
||||
const getDataList = async () => {
|
||||
try {
|
||||
const result = await tabListDataAll();
|
||||
listData.value = result || [];
|
||||
} catch (error) {
|
||||
listData.value = []; // 异常时置空列表,显示空状态
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
const count = computed(() => {
|
||||
let count = 0;
|
||||
for (let i = 0; i < listData.value.length; i++) {
|
||||
count += listData.value[i].list.length;
|
||||
}
|
||||
return count;
|
||||
});
|
||||
|
||||
function onNoticeClick(record: BizListItem) {
|
||||
createMessage.success('你点击了通知,ID=' + record.id);
|
||||
createMessage.success('你点击了' + record.title);
|
||||
getDataList()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDataList()
|
||||
});
|
||||
|
||||
return {
|
||||
prefixCls,
|
||||
|
||||
Reference in New Issue
Block a user