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.
 
 
 

77 lines
1.5 KiB

<template>
<view class="mz-button-container" :style="{width:buttonWidth}" @click="clickHandle">
<view class="mz-button-background">
<view class="mz-button-background-main" :style="{backgroundColor:buttonColor,color:fontColor}">
<view class="mz-button-content" :style="Object.assign(btnStyle,{
backgroundImage:(isBackground?'url('+staticImage.buttonBackground+')':''),
fontSize:fontSize,
padding:paddingTb+' 0',
})" >
{{ title }}
</view>
</view>
</view>
</view>
</template>
<script>
import { imghost } from '@/config/host.js'
export default{
name:'MzButton',
props:{
title:{
type:String,
default:'确认'
},
buttonColor:{
type:String,
default:'#FFFFFF'
},
fontColor:{
type:String,
default:'#131313'
},
buttonWidth:{
type:String,
default:'100%'
},
isBackground:{
type:Boolean,
default:true
},
fontSize:{
type:String,
default:'30rpx',
},
paddingTb:{
type:String,
default:'15rpx',
},
btnStyle:{
type:Object,
default:{},
},
},
data() {
return {
loading: true,
buttonBackground:imghost+"/static/image/small-button-background.png",
staticImage:{
buttonBackground:imghost+'/static/image/small-button-background.png'
}
}
},
onLoad() {
},
methods: {
clickHandle(e){
this.$emit('click',e);
}
}
}
</script>
<style lang="scss">
@import './components/index.scss';
</style>