123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <template>
- <view class="custom-header">
- <view class="title">{{ title }}</view>
- <view class="right-buttons">
- <!-- 这里可以放置更多按钮,根据需要添加 -->
- <text @click="onClickMore">更多</text>
- </view>
- </view>
- </template>
-
- <script>
- export default {
- props: {
- title: String
- },
- methods: {
- onClickMore() {
- // 处理更多按钮的点击事件
- console.log('更多按钮被点击');
- // 可以通过事件通知父组件
- this.$emit('more');
- }
- }
- }
- </script>
-
- <style scoped>
- .custom-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 10px;
- background-color: #f7f7f7;
- border-bottom: 1px solid #eee;
- }
- .title {
- font-size: 18px;
- font-weight: bold;
- }
- .right-buttons {
- display: flex;
- align-items: center;
- }
- .right-buttons text {
- margin-left: 10px;
- font-size: 16px;
- color: #000;
- /* 添加点击效果的样式 */
- cursor: pointer;
- }
- </style>
|