index.vue
712 Bytes
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
<template>
<div class="testcomp">
<el-button @click="btnClick" v-bind="$attrs" v-on="$listeners">
<!-- 默认插槽 -->
<slot></slot>
</el-button>
</div>
</template>
<script>
// @group GroupA
export default {
name:'TestComp',
props:{
// 类型的种类
demosize:{
type:String,
// `medium` / `small` / `mini`
default:'medium'
},
// demo类型
demotype:{
type:String,
// `primary` / `success`
default:'primary'
}
},
data(){
return{
}
},
methods:{
btnClick(){
// 这是点击事件
this.$emit('点击')
}
}
}
</script>
<style lang="scss">
.testcomp{
display:inline-block;
}
</style>