翻譯|使用教程|編輯:龔雪|2022-08-25 10:25:57.610|閱讀 172 次
概述:本文主要為大家介紹如何使用Kendo UI for Vue的來設置按鈕的外觀,歡迎下載最新版控件體驗!
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
Kendo UI for Vue原生組件——Button 提供了一組預定義的外觀選項。除了 Button 的默認外觀之外,這些替代樣式選項使您能夠配置組件外觀的每個單獨方面。
在上文中,我們為大家介紹了如何配置器演示、按鈕大小形狀設置等,點擊這里回顧>>
Button的圓度通過其rounded屬性控制,可以傳遞給屬性的值如下:
以下示例演示了每個舍入選項的用法:
main.vue
<template> <div> <span class="wrapper"> <kbutton>No roundness</kbutton> </span> <span class="wrapper"> <kbutton :rounded="'small'">Small roundness</kbutton> </span> <span class="wrapper"> <kbutton :rounded="'medium'">Medium roundness</kbutton> </span> <br /> <br /> <span class="wrapper"> <kbutton :rounded="'large'">Large roundness</kbutton> </span> <span class="wrapper"> <kbutton :rounded="'full'">Full roundness</kbutton> </span> <span class="wrapper"> <kbutton :size="null" :class="'custom-roundness'">Custom roundness</kbutton> </span> </div> </template> <script> import { Button } from '@progress/kendo-vue-buttons'; export default { components: { kbutton: Button, } }; </script> <style> .custom-roundness.k-button { border-top-right-radius: 15px; border-top-left-radius: 15px; } .wrapper { padding: 20px; } </style>
main.js
import { createApp } from 'vue' import App from './main.vue' createApp(App).mount('#app')
Button的樣式是通過其 fillMode 屬性控制的,可以傳遞給屬性的值如下:
以下示例演示了每個 fillMode 選項的用法:
main.vue
<template> <div> <span class="wrapper"> <kbutton :fill-mode="'solid'">Solid</kbutton> </span> <span class="wrapper"> <kbutton :fill-mode="'flat'">Flat</kbutton> </span> <span class="wrapper"> <kbutton :fill-mode="'outline'">Outline</kbutton> </span> <span class="wrapper"> <kbutton :fill-mode="'clear'">Clear</kbutton> </span> <span class="wrapper"> <kbutton :fill-mode="'link'">Link</kbutton> </span> </div> </template> <script> import { Button } from '@progress/kendo-vue-buttons'; export default { components: { kbutton: Button, }, }; </script> <style> .wrapper { padding: 20px; } </style>
main.js
import { createApp } from 'vue' import App from './main.vue' createApp(App).mount('#app')
Button 的顏色是通過其 themeColor 屬性控制的。
以下示例演示了每個 themeColor 選項的用法:
main.vue
<template> <div> <span class="wrapper"> <kbutton :theme-color="'base'">base</kbutton> </span> <span class="wrapper"> <kbutton :theme-color="'primary'">primary</kbutton> </span> <span class="wrapper"> <kbutton :theme-color="'secondary'">secondary</kbutton> </span> <span class="wrapper"> <kbutton :theme-color="'tertiary'">tertiary</kbutton> </span> <br /> <br /> <span class="wrapper"> <kbutton :theme-color="'info'">info</kbutton> </span> <span class="wrapper"> <kbutton :theme-color="'success'">success</kbutton> </span> <span class="wrapper"> <kbutton :theme-color="'warning'">warning</kbutton> </span> <span class="wrapper"> <kbutton :theme-color="'error'">error</kbutton> </span> <br /> <br /> <span class="wrapper"> <kbutton :theme-color="'dark'">dark</kbutton> </span> <span class="wrapper"> <kbutton :theme-color="'light'">light</kbutton> </span> <span class="wrapper"> <kbutton :theme-color="'inverse'">inverse</kbutton> </span> <span class="wrapper"> <kbutton :theme-color="null" :class="'custom-color'">custom</kbutton> </span> </div> </template> <script> import { Button } from '@progress/kendo-vue-buttons'; export default { components: { kbutton: Button, } }; </script> <style> .wrapper { padding: 20px; } .custom-color { background-color: green; color: orange; } </style>
main.js
import { createApp } from 'vue' import App from './main.vue' createApp(App).mount('#app')
Telerik_KendoUI產品技術交流群:726377843 歡迎一起進群討論
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都網