// 埋点插件 import { showReportDialog } from '@sentry/vue'; import clickLog from './click'; import ShowLogObserver from './show'; const AutoLog = {}; AutoLog.install = (app) => { app.directive('click-log', clickLog); app.directive('show-log', { mounted(el, binding) { // 加载阶段设置随机key标记当前元素 el.denetShowLogkey = el.denetShowLogkey || Math.random().toString(36).slice(-6); ShowLogObserver.add(el, binding); }, unmounted(el) { ShowLogObserver.remove(el); }, }); } export default AutoLog;