+60
-76
lines changedFilter options
+60
-76
lines changed Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
<script setup>
10
10
import vScroll from './../../directives/scroll';
11
-
import { computed, defineProps, ref, nextTick } from 'vue';
11
+
import { computed, ref, nextTick } from 'vue';
12
12
13
13
const props = defineProps({
14
14
offset: {
Original file line number Diff line number Diff line change
@@ -13,50 +13,46 @@
13
13
</div>
14
14
</template>
15
15
16
-
<script>
17
-
export default {
18
-
props: {
19
-
dismissible: {
20
-
type: Boolean,
21
-
default: false,
22
-
},
23
-
duration: {
24
-
type: Number,
25
-
default: 0,
26
-
},
27
-
type: {
28
-
type: String,
29
-
default: 'info',
30
-
},
31
-
},
32
-
emits: ['dismissed'],
33
-
data() {
34
-
return {
35
-
timeout: 0,
36
-
};
37
-
},
38
-
computed: {
39
-
alertClass() {
40
-
return {
41
-
alert: true,
42
-
[`alert-${this.type}`]: Boolean(this.type),
43
-
'alert-dismissible': this.dismissible,
44
-
};
45
-
},
46
-
},
47
-
mounted() {
48
-
if (this.duration > 0) {
49
-
this.timeout = setTimeout(this.closeAlert, this.duration);
50
-
}
16
+
<script setup>
17
+
import { computed, onMounted, onUnmounted } from 'vue';
18
+
19
+
const props = defineProps({
20
+
dismissible: {
21
+
type: Boolean,
22
+
default: false,
51
23
},
52
-
unmounted() {
53
-
clearTimeout(this.timeout);
24
+
duration: {
25
+
type: Number,
26
+
default: 0,
54
27
},
55
-
methods: {
56
-
closeAlert() {
57
-
clearTimeout(this.timeout);
58
-
this.$emit('dismissed');
59
-
},
28
+
type: {
29
+
type: String,
30
+
default: 'info',
60
31
},
61
-
};
32
+
});
33
+
34
+
const emit = defineEmits(['dismissed']);
35
+
36
+
let timeout = 0;
37
+
38
+
const alertClass = computed(() => ({
39
+
alert: true,
40
+
[`alert-${props.type}`]: !!props.type,
41
+
'alert-dismissible': props.dismissible,
42
+
}));
43
+
44
+
function closeAlert() {
45
+
clearTimeout(timeout);
46
+
emit('dismissed');
47
+
}
48
+
49
+
onMounted(() => {
50
+
if (props.duration > 0) {
51
+
timeout = setTimeout(closeAlert, props.duration);
52
+
}
53
+
});
54
+
55
+
onUnmounted(() => {
56
+
clearTimeout(timeout);
57
+
});
62
58
</script>
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
1
1
<template>
2
2
<li :class="{ active }">
3
3
<slot v-if="active" />
4
-
<router-link
4
+
<RouterLink
5
5
v-else-if="to"
6
6
:to="to"
7
7
:replace="replace"
8
8
:append="append"
9
9
:exact="exact"
10
10
><slot
11
-
/></router-link>
11
+
/></RouterLink>
12
12
<a v-else :href="href" :target="target"><slot /></a>
13
13
</li>
14
14
</template>
15
15
16
-
<script>
17
-
import linkMixin from '../../mixins/link.mixin';
18
-
19
-
export default {
20
-
mixins: [linkMixin],
21
-
props: {
22
-
active: {
23
-
type: Boolean,
24
-
default: false,
25
-
},
26
-
},
27
-
};
16
+
<script setup>
17
+
defineProps({
18
+
// <a> props
19
+
href: { type: String, default: undefined },
20
+
target: { type: String, default: undefined },
21
+
// <router-link> props
22
+
to: { type: null, default: undefined },
23
+
replace: { type: Boolean, default: false },
24
+
append: { type: Boolean, default: false },
25
+
exact: { type: Boolean, default: false },
26
+
active: { type: Boolean, default: false },
27
+
});
28
28
</script>
Original file line number Diff line number Diff line change
@@ -3,12 +3,8 @@
3
3
<slot />
4
4
<BreadcrumbItem
5
5
v-for="(item, index) of items"
6
-
:key="hasOwnProperty(item, 'key') ? item.key : index"
7
-
:active="
8
-
hasOwnProperty(item, 'active')
9
-
? item.active
10
-
: index === items.length - 1
11
-
"
6
+
:key="item.key ?? index"
7
+
:active="item.active ?? index === items.length - 1"
12
8
:href="item.href"
13
9
:to="item.to"
14
10
:replace="item.replace"
@@ -19,18 +15,10 @@
19
15
</ol>
20
16
</template>
21
17
22
-
<script>
18
+
<script setup>
23
19
import BreadcrumbItem from './BreadcrumbItem.vue';
24
-
import { hasOwnProperty } from '../../utils/object.utils';
25
20
26
-
export default {
27
-
functional: true,
28
-
components: { BreadcrumbItem },
29
-
props: {
30
-
items: { type: Array, default: () => [] },
31
-
},
32
-
methods: {
33
-
hasOwnProperty,
34
-
},
35
-
};
21
+
defineProps({
22
+
items: { type: Array, default: () => [] },
23
+
});
36
24
</script>
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4