网络知识 娱乐 UI组件库Kendo UI for Vue中文入门指南(四)

UI组件库Kendo UI for Vue中文入门指南(四)

{"data":{"title":"UI组件库Kendo UI for Vue中文入门指南(四)","abstract":"请注意仅当 windowVisible 标志值为 true 时才会呈现 Window。从版本 2.0.0 开始,使用 Kendo UI for Vue 库中的任何 UI 组件都需要商业许可证密钥或有效的试用许可证密钥。","cover":"https://p3.toutiaoimg.com/origin/tos-cn-i-qvj2lq49k0/28431f86060849b69642dd334043652a","articleType":"article","itemId":"7112614921925575209","groupId":"7112614921925575209","groupSource":2,"isOriginal":false,"banComment":false,"publishTime":"2022-06-24 09:41","source":"慧都科技","tag":"technique","mediaSite":null,"pathname":"/article/7112614921925575209/","loginUserInfo":null,"favorite":false,"relation":{"isFollowing":false,"isFollowed":false},"likeData":{"userLikeStatus":0,"count":0},"isSelf":false,"content":"

在本文中,您将通过构建一个包含 Grid、DropDownList、Window 和设计主题的小应用程序来学习如何使用Kendo UI for Vue组件。

Kendo UI官方最新版免费下载试用,历史版本下载,在线文档和帮助文件下载-慧都网

7. 添加一个Kendo UI for Vue窗口

products 数组包含一些未显示在网格中的字段。 在本节中,您将使用Kendo UI for Vue Window在用户选择网格行时显示这些附加产品详细信息。

以下是所需的步骤,首先导入Window组件:

import { Window } from '@progress/kendo-vue-dialogs';nnexport default {nname: 'App',ncomponents: {n//..............n'window': Windown},n//..............

接下来,定义新的 windowVisible 和 gridClickedRow 数据属性。

data: function() {nreturn {n//..............ngridClickedRow:{},nwindowVisible: falsen}n}

接下来,将row click handler添加到 Grid。

<grid @rowclick="rowClick">n//..............n</grid>

之后,添加下面的rowClick函数,它将windowVisible标志设置为true,并将被点击行的数据项分配给gridClickedRow属性,您将使用数据项值来呈现 Window 的内容。

methods: {n//..............nrowClick (event){nthis.windowVisible=true;nthis.gridClickedRow=event.dataItem;n}n//..............n}

接下来,添加以下 Window 声明。 (在模板中的 Grid 定义之后立即添加它。)请注意仅当 windowVisible 标志值为 true 时才会呈现 Window。

<window v-if="windowVisible" :title="'Product Details'" @close="closeWindow" :height="250">n<dl style="{textAlign:left}">n<dt>Product Name</dt>n<dd>{{gridClickedRow.ProductName}}</dd>n<dt>Product ID</dt>n<dd>{{gridClickedRow.ProductID}}</dd>n<dt>Quantity per Unit</dt>n<dd>{{gridClickedRow.QuantityPerUnit}}</dd>n</dl>n</window>

最后,添加以下 Window 关闭处理程序,当用户关闭 Window 时,它将 windowVisible 标志设置为 false。

methods: {n//..............ncloseWindow (){nthis.windowVisible=false;n}n}

使用此代码,尝试点击网格中的一行,您应该会看到一个带有附加产品信息的自定义窗口。

再一次注意这个功能的实现是多么简单,使用Kendo UI for Vue,您可以获得一组易于插入的Vue 组件——在这种情况下,构建一个可定制的跨浏览器友好的窗口,这就是Kendo UI for Vue的强大之处。

8. 激活您的试用或商业许可证

Kendo UI for Vue是一个专业开发的库,在商业许可下分发。 从版本 2.0.0 开始,使用 Kendo UI for Vue 库中的任何 UI 组件都需要商业许可证密钥或有效的试用许可证密钥。请按照Kendo UI for Vue My License页面上的说明激活您的许可证。

9. 完整的源代码

Kendo UI for Vue Getting Started应用程序已完成! 您可以从 kendo-vue-examples GitHub 存储库下载并运行完整的示例应用程序,或者直接在StackBlitz 中运行、派生和试验应用程序。

  • 如果您使用的是 Vue 2,这里是指向在 Vue 2 上下文中实现的同一项目的链接。

10. VSCode 扩展

为了帮助您更快地创建项目,我们引入了 Kendo UI VS Code Template Wizard。

Kendo UI for Vue

Kendo UI致力于新的开发,来满足不断变化的需求。Kendo UI for Vue使用旨在提高性能和丰富用户体验的Vue组件,帮助开发人员构建下一代应用程序。它是为Vue技术框架提供可用的Kendo UI组件,以便更快地构建更好的Vue应用程序。

","imageList":[],"mediaInfo":{"userId":"MS4wLjABAAAA2wg1fu5OOMc0EB6RPqDCAkDvksXQtsxP4qYT5wRRvTk","unsafeUserId":"3388667986","name":"慧都科技","avatarUrl":"https://p3.toutiaoimg.com/large/fe270000082626790f60","description":"赋能企业智慧力量,助力企业完成智能化升级转型","userVerified":1,"userAuthInfo":""},"seoTDK":{"title":"UI组件库Kendo UI for Vue中文入门指南(四)-今日头条","description":"请注意仅当 windowVisible 标志值为 true 时才会呈现 Window。从版本 2.0.0 开始,使用 Kendo UI for ","keywords":"浏览器,GitHub,跳槽那些事儿,设计","publishTimestamp":"1656034886","modifiedTimestamp":"1656038791"},"logId":"202206241300310102112100341C5ECBE7","sylpageConfig":{"card":{"id":""}},"identity":{"web_id":"7111199547455817229","user_is_login":false},"abtestInfo":{"rsp_type":5,"version_name":"4252807,4164637","parameters":{"feat_repost_type":{"new":true},"home_nav_conf":{"dcd_out":1},"local_filter":{"core_filter":{"filter_list":{"ms::TicaiFilter":true}}},"page_upgrade":{"new_profile":true,"video_double_column":true},"sati":{"enable_ad_prime":true,"enable_sorter_optimus":true,"prime_rule_rank_version":"toutiao_web","use_toutiao_web_feed":true,"format_max_consecutive_middle":2,"format_max_consecutive_nogroups":3,"enable_reduce_nogroup":true},"seraph":{"score_rule":{"default":{"replace":{"group_util":"_CTR - 1000*dislike"}},"new_user":{"replace":{"group_util":"_CTR - 1000*dislike"}}}},"sort":{"allowed_ticai":["forum_post","pgc_text","pgc_video"]},"video_detail_page_upgrade":{"new_page":true}},"env_flag":0},"localCityInfo":{"name":"北京","code":"110000","channelId":3202164529},"showResearch":false}}