Bootstrap-vue: How to use vue-router with list group items?

Created on 10 Apr 2017  路  1Comment  路  Source: bootstrap-vue/bootstrap-vue

I have the following template:

<b-card header="My Posts">
    <b-list-group flush>
      <b-list-group-item v-for="post in posts" :key="post.id" action>
        <router-link :to="{name: 'PostView', params: {id: post.id}}">{{ post.title }}</router-link>
      </b-list-group-item>
    </b-list-group>
  </b-card>

Is it possible to use :to in b-list-group-item with a value such as the one above?

Question

Most helpful comment

@BigChief45 You don't even a nested just pass to prop to list-group item :)

<b-card header="My Posts">
    <b-list-group flush>
      <b-list-group-item v-for="post in posts" :key="post.id" :to="{name: 'PostView', params: {id: post.id}}" action>
            {{ post.title }}
      </b-list-group-item>
    </b-list-group>
  </b-card>

>All comments

@BigChief45 You don't even a nested just pass to prop to list-group item :)

<b-card header="My Posts">
    <b-list-group flush>
      <b-list-group-item v-for="post in posts" :key="post.id" :to="{name: 'PostView', params: {id: post.id}}" action>
            {{ post.title }}
      </b-list-group-item>
    </b-list-group>
  </b-card>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

arnoldtkl picture arnoldtkl  路  3Comments

KonradDeskiewicz picture KonradDeskiewicz  路  3Comments

studnitz picture studnitz  路  3Comments

tpines picture tpines  路  3Comments

StephenPCG picture StephenPCG  路  3Comments