D
D
danilr2019-06-19 19:49:57
Vue.js
danilr, 2019-06-19 19:49:57

How in this component to set a class at the top level?

Vue.component('v-dropdown-list', {
  render(h) {
    const items = this.$slots.default;
    return h('div', [
      items.slice(0, this.minShow),
      h('div', {
        ref: 'dropdown',
        attrs: {
          style: `overflow: hidden; transition: height ${this.duration}ms`
        },
      }, items.slice(this.minShow)),
    ]);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-06-19
@danilr

As the second parameter, pass an object with data, in which you will need to specify the class property:

return h('div', {
  class: здесь строка с классами, или объект, или массив
}, [
  ...

Well, in general - it will be useful to read this .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question