You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
934 B

2 months ago
<template>
<view :class="'jnpf-button jnpf-button-'+align">
<u-button :custom-style="customStyle" :type="realType" :disabled="disabled" @click="onClick">{{buttonText}}
</u-button>
</view>
</template>
<script>
export default {
props: {
align: {
default: 'left'
},
buttonText: {
default: ''
},
disabled: {
type: Boolean,
default: false
},
type: {
default: ''
}
},
computed: {
realType() {
return !this.type ? 'default' : this.type === 'danger' ? 'error' : this.type
}
},
data() {
return {
customStyle: {
display: 'inline-block'
}
}
},
methods: {
onClick(event) {
this.$emit('click', event)
}
}
}
</script>
<style lang="scss" scoped>
.jnpf-button {
width: 100%;
&.jnpf-button-left {
text-align: left;
}
&.jnpf-button-center {
text-align: center;
}
&.jnpf-button-right {
text-align: right;
}
}
</style>