123456789101112131415161718 |
- import { defineStore } from 'pinia'
- export const useErrorlog = defineStore('errorLog', {
- state: () => ({
- logs: [],
- }),
- actions: {
- addErrorLog(log) {
- // 可以根据需要将错误上报给服务器
- // ....code.......
- this.logs.push(log)
- },
- clearErrorLog() {
- this.logs.splice(0)
- },
- },
- })
|