mirror of
https://gitee.com/myxzgzs/boyue_jnpf.git
synced 2025-08-10 00:02:41 +08:00
60 lines
956 B
Vue
60 lines
956 B
Vue
<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 {
|
|
name: 'jnpf-button',
|
|
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> |