Git Product home page Git Product logo

Comments (8)

Scrum avatar Scrum commented on June 9, 2024

@letanure Hi, try

Vue.use(breadcrumbs, {
  methods: {
    getBreadcrumbs() {...}
  },
  template: '#crumbs'
});

from vue-2-breadcrumbs.

dlishtvan avatar dlishtvan commented on June 9, 2024

@letanure Hi, try

Vue.use(breadcrumbs, {
  methods: {
    getBreadcrumbs() {...}
  },
  template: '#crumbs'
});

unfortunately same error

from vue-2-breadcrumbs.

Scrum avatar Scrum commented on June 9, 2024

hmmm, may be

<script>
import Vue from 'vue';
import breadcrumbs from 'vue-2-breadcrumbs';

Vue.use(breadcrumbs, {
  template: '#crumbs'
});

export default {
  methods: {
    getBreadcrumbs() {...}
  }
}
</script>

if you don’t work out, put an example on a github I’ll try to solve this problem

from vue-2-breadcrumbs.

dlishtvan avatar dlishtvan commented on June 9, 2024

hmmm, may be

<script>
import Vue from 'vue';
import breadcrumbs from 'vue-2-breadcrumbs';

Vue.use(breadcrumbs, {
  template: '#crumbs'
});

export default {
  methods: {
    getBreadcrumbs() {...}
  }
}
</script>

this is work, but how I can extend code of this method, for example I need something like this.

export default {
  methods: {
    getBreadcrumbs = breadcrumbs.getBreadcrumbs();
  }
}

and just use it on my template? Do you understand what I want?

from vue-2-breadcrumbs.

dlishtvan avatar dlishtvan commented on June 9, 2024

Снимок экрана 2019-04-25 в 13 01 54

from vue-2-breadcrumbs.

Scrum avatar Scrum commented on June 9, 2024

Do you understand what I want?

I'm not sure that I understand your idea, but it is probably worth making it as a component and reuse it.

from vue-2-breadcrumbs.

dlishtvan avatar dlishtvan commented on June 9, 2024

I made as in a doc.

Vue.use(VueBreadcrumbs, {
  template:
    `<nav class="breadcrumb" v-if="$breadcrumbs.length" aria-label="breadcrumb">
      <ol class="breadcrumb">
        <li v-for="(crumb, key) in $breadcrumbs" v-if="crumb.meta.breadcrumb" :key="key" class="breadcrumb-item active" aria-current="page">
          <router-link :to="{ path: crumb.path }">{{ getBreadcrumb(crumb.meta.breadcrumb) }}</router-link>
        </li>
      </ol>
    </nav>`
});

Can I close issue?

from vue-2-breadcrumbs.

Scrum avatar Scrum commented on June 9, 2024

Can I close issue?

Of course, if you find a solution

from vue-2-breadcrumbs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.