| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <template>
- <view class="device-config-card">
- <view class="card-header">
- <text class="card-title">{{ title }}</text>
- <u-button
- v-if="showAction"
- type="primary"
- size="mini"
- @click="handleAction"
- >
- {{ actionText }}
- </u-button>
- </view>
-
- <view class="card-content">
- <slot></slot>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'DeviceConfigCard',
- props: {
- title: {
- type: String,
- default: '设备配置'
- },
- showAction: {
- type: Boolean,
- default: false
- },
- actionText: {
- type: String,
- default: '操作'
- }
- },
- methods: {
- handleAction() {
- this.$emit('action')
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import '@/static/scss/custom-theme.scss';
- .device-config-card {
- @include card-style;
- margin-bottom: $custom-spacing-md;
-
- .card-header {
- @include flex-between;
- margin-bottom: $custom-spacing-md;
- padding-bottom: $custom-spacing-sm;
- border-bottom: 1px solid $custom-border-primary;
-
- .card-title {
- font-size: 16px;
- font-weight: bold;
- color: $custom-text-primary;
- }
- }
-
- .card-content {
- // 内容区域样式
- }
- }
- </style>
|