- Notifications
You must be signed in to change notification settings - Fork 4.1k
/
Copy pathOther.vue
66 lines (62 loc) · 1.14 KB
/
Other.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
<script>
import { h } from'vue'
// this computed property should be visible
// even if component has no 'computed' defined
constcomputedPropMixin= {
computed: {
computedPropFromMixin() {
returnnull
},
},
}
exportdefault {
name:'OtherWithMine',
components: {
Mine: {
inject: ['foo', 'noop', 'answer'],
render: () =>h('div', { class:'mine' }, 'mine'),
data() {
return {
// testing all data types
a() {},
b:/123/,
c:document.createElement('div'),
d:null,
e:undefined,
f:true,
g:12345,
h:'I am a really long string mostly just to see how the horizontal scrolling works.',
}
},
},
},
mixins: [computedPropMixin],
provide: {
foo:'bar',
noop: (a, b, c) => {},
answer:42,
},
inheritAttrs:false,
props: ['id'],
data() {
consta= { c() {} }
a.a= a
constb= []
b[0] = b
return {
a,
b,
}
},
}
</script>
<template>
<div>
Other {{ id }}
<Mine />
</div>
</template>
<style lang="stylus">
.mine
displayinline-block
</style>