-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHeader.vue
49 lines (44 loc) · 938 Bytes
/
Header.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
<template>
<div @click="onClick()" class="vue-header">Vue.js App {{ title }}</div>
</template>
<script>
export default {
name: 'Header',
props: ['title'],
emits: ['headerclick'],
methods: {
onClick() {
this.$emit('headerclick', 'vue clicked');
},
},
/* If you define style here
you will able to use styles:
- inside shadow dom,
- inside 🍻 Web Components.
Vue must declare styles[]
automaticly from <style> tag,
but it doesn't happened to me,
so just copy it.
*/
// use it for 🍻 Web Components
styles: [
`.vue-header {
padding: 16px;
margin: 2px;
border-radius: 8px;
background: mediumseagreen;
border: 3px solid rgba(0, 0, 0, 0.6);
}`,
],
};
</script>
// use it for default exporting
<style>
.vue-header {
padding: 16px;
margin: 2px;
border-radius: 8px;
background: mediumseagreen;
border: 3px solid rgba(0, 0, 0, 0.6);
}
</style>