yaminncco / vue-sidebar-menu

A Vue.js Sidebar Menu Component
MIT License
646 stars 194 forks source link

[help] hidden hr separator #248

Closed ILOG9 closed 1 year ago

ILOG9 commented 1 year ago

I have tried to add an hr to separate the elements as indicated by the demo folder, however it does not work

and here is an example of use

const menu = [ { component: { template: '<hr style="border-color: rgba(0, 0, 0, 0.1); margin: 20px;">' } } ]

As you navigate through the code, you can see that the li tag that corresponds to the component position in the array appears with a comment.

note: for the above example i have replaced `` with '' so that github doesn't break

Thanks for the help!

yaminncco commented 1 year ago

Can you show more code, do you have any error/warn?

yaminncco commented 1 year ago

You can use render function

import { h } from 'vue'
const separator = h('hr', {
  style: {
    borderColor: 'rgba(0, 0, 0, 0.1)',
    margin: '20px'
  }
})
ILOG9 commented 1 year ago

That was exactly what I needed, thanks for your time