Files
shoot-miniprograms/src/components/SButton.vue

39 lines
588 B
Vue
Raw Normal View History

2025-05-10 16:57:36 +08:00
<script setup>
const props = defineProps({
width: {
type: String,
default: "calc(100vw - 20px)",
},
rounded: {
type: Number,
default: 10,
},
onClick: {
type: Function,
default: () => {},
},
});
</script>
<template>
<view
class="container"
:style="{ width: width, borderRadius: rounded + 'px' }"
@click="onClick"
>
<slot />
</view>
</template>
<style scoped>
.container {
margin: 0 auto;
height: 40px;
line-height: 40px;
font-weight: bold;
background-color: #fed847;
font-size: 15px;
text-align: center;
}
</style>