UI流程完善
This commit is contained in:
38
src/components/SButton.vue
Normal file
38
src/components/SButton.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user