KendoUI 官方示例之 Grid / Detail template

本文详细介绍了如何使用KendoUI的网格详情模板功能,并提供了实践示例供开发者参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<template> <view class="workbench-container"> <!-- 顶部轮播图 --> <view class="swiper-container"> <swiper class="swiper" :autoplay="true" :interval="3000" :duration="500" circular indicator-dots indicator-color="rgba(255,255,255,0.5)" indicator-active-color="#007AFF" > <swiper-item v-for="(item, index) in swiperItems" :key="index"> <image class="swiper-image" :src="item.image" mode="aspectFill" /> <view class="swiper-title">{{ item.title }}</view> </swiper-item> </swiper> </view> <!-- 工具板块 --> <view class="tools-section"> <text class="section-title">工作工具</text> <view class="tools-grid"> <!-- 民意测评按钮 --> <view class="tool-item" @click="navigateToMycpDetail" > <view class="tool-icon" style="background-color: #e6f7ff;"> <u-icon name="edit-pen" size="50" color="#1890ff"></u-icon> </view> <text class="tool-label">民意测评</text> </view> <!-- 其他工具按钮 --> <view class="tool-item" v-for="(tool, index) in tools" :key="index" @click="handleToolClick(tool)" > <view class="tool-icon" :style="{ backgroundColor: tool.bgColor }"> <u-icon :name="tool.icon" size="50" :color="tool.color"></u-icon> </view> <text class="tool-label">{{ tool.name }}</text> </view> </view> </view> <!-- 待办事项区域 --> <view class="todo-section"> <text class="section-title">待办事项</text> <!-- 待办事项内容 --> </view> </view> </template> <script> import { ref } from 'vue' export default { setup() { // 轮播图数据 const swiperItems = ref([ { image: 'static\workbanch\banner\workbench\1.jpg', title: '高效工作从工作台开始' }, { image: '/static/swiper2.jpg', title: '最新公告与通知' }, { image: '/static/swiper3.jpg', title: '系统更新与优化' } ]) // 导航到民意测评详情页 const navigateToMycpDetail = () => { uni.navigateTo({ url: '/pages/workbench/mycp/detail/detail', animationType: 'slide-in-right', animationDuration: 300 }) } // 其他工具点击处理 const handleToolClick = (tool) => { uni.showToast({ title: `打开${tool.name}`, icon: 'none' }) } return { swiperItems, tools, navigateToMycpDetail, handleToolClick } } } </script> <style lang="scss" scoped> .workbench-container { padding: 0 20rpx 40rpx; background-color: #f5f7fa; min-height: 100vh; } /* 轮播图样式 */ .swiper-container { height: 360rpx; border-radius: 20rpx; overflow: hidden; margin: 20rpx 0 30rpx; box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.1); } .swiper { height: 100%; position: relative; } .swiper-image { width: 100%; height: 100%; display: block; } .swiper-title { position: absolute; bottom: 0; left: 0; right: 0; padding: 20rpx; background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent); color: white; font-size: 32rpx; font-weight: bold; } /* 工具板块样式 */ .section-title { font-size: 36rpx; font-weight: bold; margin: 30rpx 0 20rpx; display: block; padding-left: 10rpx; border-left: 8rpx solid #007AFF; } .tools-section { background: #ffffff; border-radius: 20rpx; padding: 30rpx; box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.05); } .tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30rpx; } .tool-item { display: flex; flex-direction: column; align-items: center; transition: all 0.2s ease; } .tool-item:active { transform: scale(0.95); } .tool-icon { width: 100rpx; height: 100rpx; border-radius: 24rpx; display: flex; justify-content: center; align-items: center; margin-bottom: 15rpx; } .tool-label { font-size: 26rpx; color: #333; text-align: center; } /* 待办事项区域 */ .todo-section { background: #ffffff; border-radius: 20rpx; padding: 30rpx; margin-top: 30rpx; box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.05); } /* 响应式调整 */ @media (max-width: 768px) { .tools-grid { grid-template-columns: repeat(3, 1fr); gap: 25rpx; } .swiper-container { height: 300rpx; } } @media (max-width: 480px) { .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 20rpx; } .swiper-container { height: 260rpx; } .section-title { font-size: 32rpx; } } </style> 报错:[plugin:vite:vue] [vue/compiler-sfc] The only valid numeric escape in strict mode is '\'. (72:51) D:/桌面/开发项目/vue3-uni-Project01/pages/workbench/workbench.vue74好, D:/泉面/开发项目/vue3-uni-Project01/pages/workbench/workbench.vue:72:51 5 <swiper 6 class="swiper' :autoplay="true’ 8 9 :interval="3000' :duration="500' 我想要轮播图使用文件目录static\workbanch\banner\workbench 下的1.jpg
最新发布
08-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值