Item.vue 485 B

1234567891011121314151617181920212223242526272829
  1. <script>
  2. export default {
  3. name: "MenuItem",
  4. functional: true,
  5. props: {
  6. icon: {
  7. type: String,
  8. default: ""
  9. },
  10. title: {
  11. type: String,
  12. default: ""
  13. }
  14. },
  15. render(h, context) {
  16. const { icon, title } = context.props;
  17. const vnodes = [];
  18. if (icon) {
  19. vnodes.push(<i class={"svg-icon el-icon-" + icon}></i>);
  20. }
  21. if (title) {
  22. vnodes.push(<span slot="title">{title}</span>);
  23. }
  24. return vnodes;
  25. }
  26. };
  27. </script>