### El-PageHeader Basic Usage Example Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/page-header.md This snippet demonstrates the fundamental implementation of the El-PageHeader component, including its content display and a method to handle the back button click event. ```html ``` ```javascript ``` -------------------------------- ### Basic Usage of Element Link Component Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/link.md Demonstrates the fundamental usage of the `el-link` component, showcasing various link types such as default, primary, success, warning, danger, and info, along with an example of adding an icon. ```html
默认链接 主要链接 主题色链接 成功链接 警告链接 危险链接 信息链接
``` -------------------------------- ### OMarkdown Basic Usage Example Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/markdown.md Demonstrates the fundamental integration of the OMarkdown component, initializing it with a default markdown value and basic upload options. This snippet shows how to embed the component and set up initial data. ```html ``` -------------------------------- ### Adding Icons to Element Link Component Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/link.md Explains how to integrate icons with `el-link` components to enhance visual recognition. Examples include placing an icon before the text and after the text. ```html
编辑 查看
``` -------------------------------- ### Basic Usage of AppBar Component with Fixed Positions Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/app-bar.md This example demonstrates the basic usage of the `o-app-bar` component, showing how to dynamically change its fixed position using buttons. It includes a template for the UI and a script for managing component data and methods. ```html ``` ```javascript export default { data(){ return { fixed: 'none', block: true, size: 'md' } }, computed:{ }, methods: { handleFixed (val) { this.fixed = val } }, mounted(){ } } ``` -------------------------------- ### GM Backend Form Example with o-window and Element UI Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/gm-form.md This snippet demonstrates a comprehensive GM backend form using the `o-window` component for modal display. It integrates `el-form` for structure and various Element UI components (input, date picker, switch, checkboxes, radio buttons, textarea) along with custom `o-multiselect` components. The example also illustrates how to manage form data, handle submissions with a loading state, and dynamically populate options for select fields. ```html 主要按钮 成功按钮 信息按钮 警告按钮 危险按钮 默认按钮
确定 取消
``` -------------------------------- ### Basic Usage of El-Pagination Component Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/pagination.md Demonstrates the fundamental use of the `el-pagination` component. The `layout` attribute defines the displayed elements like previous/next buttons, page numbers, total count, and jump functionality. Examples show behavior for both few and many pages. ```html
页数较少时的效果
大于 7 页时的效果
``` -------------------------------- ### El-Pagination with Advanced Features and Event Handling Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/pagination.md Presents a comprehensive example demonstrating various advanced functionalities of the `el-pagination` component. It includes handling `size-change` and `current-change` events, displaying total item count, adjusting items per page using `page-sizes`, and direct page jumping with `jumper`. ```html ``` ```javascript export default { methods: { handleSizeChange(val) { console.log(`每页 ${val} 条`); }, handleCurrentChange(val) { console.log(`当前页: ${val}`); } }, data() { return { currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4 }; } } ``` -------------------------------- ### Implement Dashboard-style Progress Bar Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/progress.md Illustrates how to create a dashboard-style progress indicator by setting the `type` property to `dashboard`. This example also includes interactive buttons to adjust the percentage and demonstrates custom color ranges for the dashboard. ```HTML
``` ```JavaScript export default { data() { return { percentage: 10, colors: [ {color: '#f56c6c', percentage: 20}, {color: '#e6a23c', percentage: 40}, {color: '#5cb87a', percentage: 60}, {color: '#1989fa', percentage: 80}, {color: '#6f7ad3', percentage: 100} ] }; }, methods: { increase() { this.percentage += 10; if (this.percentage > 100) { this.percentage = 100; } }, decrease() { this.percentage -= 10; if (this.percentage < 0) { this.percentage = 0; } } } } ``` -------------------------------- ### Element UI Click-to-Upload with File Limits and Removal Confirmation Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/upload.md This example shows how to implement a click-triggered file upload using Element UI. It demonstrates customizing the upload button via slots, setting a file upload limit, handling exceeding files, and confirming file removal before action. ```HTML 点击上传
只能上传jpg/png文件,且不超过500kb
``` -------------------------------- ### Basic Usage of Collapse Panel with Multiple Active Items Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/collapse.md This example demonstrates the fundamental usage of the el-collapse component. It allows multiple panels to be open simultaneously. The v-model is bound to an array activeNames to control the currently active panels, and the change event handler logs the updated active panels. ```html
与现实生活一致:与现实生活的流程、逻辑保持一致,遵循用户习惯的语言和概念;
在界面中一致:所有的元素和结构需保持一致,比如:设计样式、图标和文本、元素的位置等。
控制反馈:通过界面样式和交互动效让用户可以清晰的感知自己的操作;
页面反馈:操作后,通过页面元素的变化清晰地展现当前状态。
简化流程:设计简洁直观的操作流程;
清晰明确:语言表达清晰且表意明确,让用户快速理解进而作出决策;
帮助用户识别:界面简单直白,让用户快速识别而非回忆,减少用户记忆负担。
用户决策:根据场景可给予用户操作建议或安全提示,但不能代替用户进行决策;
结果可控:用户可以自由的进行操作,包括撤销、回退和终止当前操作等。
``` -------------------------------- ### Basic Usage of InputNumber Component Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/input-number.md To use the `el-input-number` component, simply bind a variable using `v-model`. The initial value of the variable will serve as the default. This example also demonstrates handling the `change` event and setting `min` and `max` limits. ```html ``` -------------------------------- ### JavaScript UI Configuration Data Fragment Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/cascader.md This JavaScript object literal fragment provides a partial view of a UI configuration, detailing items with 'label', 'value', 'leaf', and 'level' properties. It includes a continuation of an unnamed list and the start of a 'project' specific list, demonstrating a common pattern for structured configuration data in UI applications. ```JavaScript "label": "sentry", "value": "sentry", "leaf": true, "level": 1 }, { "label": "test", "value": "test", "leaf": true, "level": 1 }, { "label": "translate", "value": "translate", "leaf": true, "level": 1 }, { "label": "uap", "value": "uap", "leaf": true, "level": 1 }, { "label": "usercenter", "value": "usercenter", "leaf": true, "level": 1 }, { "label": "web", "value": "web", "leaf": true, "level": 1 }, { "label": "world", "value": "world", "leaf": true, "level": 1 }, { "label": "worldDbSlave", "value": "worldDbSlave", "leaf": true, "level": 1 } ], project: [ { "label": "bigData", "value": "bigData", "leaf": true, "level": 1 }, { "label": "boe", "value": "boe", "leaf": true, "level": 1 }, { "label": "dk", "value": "dk", "leaf": true, "level": 1 }, { "label": "dm", "value": "dm", "leaf": true, "level": 1 }, { "label": "emc", "value": "emc", "leaf": true, "level": 1 }, { "label": "gameSupport", "value": "gameSupport", "leaf": true, "level": 1 }, { "label": "gos", "value": "gos", "leaf": true, "level": 1 }, { "label": "gs", "value": "gs", "leaf": true, "level": 1 }, { "label": "koh", "value": "koh", ``` -------------------------------- ### Basic Usage of o-frame Component in Vue.js Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/frame.md This example demonstrates the fundamental structure and dynamic control of the `o-frame` component. It shows how to define the main frame, header, footer, left, and right sections using slots, and how to dynamically adjust their visibility and layout properties (like `fillHeader`, `fillFooter`, `transition`, `headerSize`, `footerSize`, `leftSize`, `rightSize`) using Vue data properties and `el-form` controls. ```html ``` ```javascript export default { data () { return { fillHeader: 'both', fillFooter: 'both', showHeader: true, showFooter: true, showLeft: true, showRight: true, headerSize: 50, footerSize: 50, leftSize: 100, rightSize: 100, transition: true } } } ``` -------------------------------- ### o-department Component: Basic User Selection Source: https://github.com/shayelee/onev-ui/blob/main/examples/docs/zh-CN/department.md This snippet illustrates how to adapt the `o-department` component for selecting users instead of departments. By setting the `type` prop to 'user', the component's behavior changes to handle user data. Examples include both multiple and single user selection, along with options for hiding the save button. The JavaScript logic for data and methods is shared with the department selection example. ```html