Q
Q
qwentry2022-04-01 13:28:22
Bootstrap
qwentry, 2022-04-01 13:28:22

How to implement adding or removing a row in bootstrap vue?

Good afternoon.
Can you please tell me how to add or remove a line?

There is a table:

<b-table
      :items="items"
      :fields="fields"
      :sticky-header="stickyHeader"
      head-variant="light"
      class="mt-5 mx-3"
    >
    </b-table>


As well as field & items
stickyHeader: true,

      items: [
        { login: 'user1', password: 'pass1', is_blocked: true, },
        { login: 'user2', password: 'pass2', is_blocked: false},
      ],
      fields: [
        {
          key: 'login',
          label: 'Login',
        },
        {
          key: 'password',
          label: 'Password',
        },
        {
          key: 'is_blocked',
          label: 'Blocked',
          formatter: (value, key, item) => {
            return value ? 'Yes' : 'No'
          },
          sortable: true,
        },
      ],


I didn’t see any examples or usage in the dock, but maybe I didn’t read carefully.
The bottom line is that you need to add a line and that would fly away to the back, or delete it and, accordingly, on the back too.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question