-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dev.vue
72 lines (60 loc) · 1.89 KB
/
Dev.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<script setup lang="ts">
import { ref, computed } from 'vue'
import { testFnOne } from './testfn'
import { logger, vueLogger } from './loggertest'
logger.log('Hello logger')
vueLogger.log('Hello logger')
logger.run()
vueLogger.run()
const result = ref<number>(0)
const timesTwo = computed(() => result.value * 2)
function add(a: number, b: number) {
logger.run()
vueLogger.run()
result.value = a + b
console.log('console.log result:', a, b, result, timesTwo)
logger.log('logger.log result:', a, b, result, timesTwo)
vueLogger.log('vuelogger.log result:', a, b, result, timesTwo)
return result
}
function testLog() {
logger.log('logger log')
vueLogger.log('logger log')
}
function testDebug() {
logger.debug('logger debug')
vueLogger.debug('logger debug')
}
function testInfo() {
logger.info('logger info')
vueLogger.info('logger info')
}
function testWarn() {
logger.warn('logger warn')
vueLogger.warn('logger warn')
}
function testError() {
logger.error('logger error')
vueLogger.error('logger error')
}
function testCritical() {
logger.critical('logger critical')
vueLogger.critical('logger critical')
}
function testSuccess() {
logger.success('logger success')
vueLogger.success('logger success')
}
</script>
<template>
<h1>Hello logger</h1>
<button data-testid="add" @click="add(1, 2)">Add</button>
<button data-testid="fn" @click="testFnOne()">Test fn</button>
<button data-testid="log" @click="testLog()">Test log</button>
<button data-testid="debug" @click="testDebug()">Test debug</button>
<button data-testid="info" @click="testInfo()">Test info</button>
<button data-testid="warn" @click="testWarn()">Test warn</button>
<button data-testid="errorb" @click="testError()">Test error</button>
<button data-testid="critical" @click="testCritical()">Test critical</button>
<button data-testid="success" @click="testSuccess()">Test success</button>
</template>