<template>
<uni-shadow-root class="vant-weapp-button-index">
<button ref="van-button" :class="getClass('button', [type, size, { plain, round }])" :type="type">
<text v-if="text">{{text}}</text>
<slot v-else></slot>
</button>
</uni-shadow-root>
</template>
<script lang="uts">
export default {
name: "van-button",
props: {
text: {
type: String,
default: ''
},
type: {
type: String,
default: 'default'
},
size: {
type: String,
default: 'normal'
},
plain: {
type: Boolean,
default: false
},
round: {
type: Boolean,
default: true
}
},
methods: {
getClass(name : string, conf : any[]) : string {
console.log(JSON.stringify(conf))
return name + JSON.stringify(conf)
},
}
}
</script>
0 个回复