neuronetio / gantt-elastic

Gantt Chart [ javascript gantt chart, gantt component, vue gantt, vue gantt chart, responsive gantt, project manager , vue projects ]

Home Page:https://neuronet.io/gantt-elastic/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I invoke function in 'title'?

awakelee opened this issue · comments

title: ` <a @click="this.$router.push({ path: /user/${task.id}})">${task.post.title}</a>`,

here I want to go to a new page with vue-router,but it doesn't work and be compiled as:

image

I raise this because by using 'href' to redirect to a new page will clear all state in vuex.

I think you need to replace component from gantt that is responsible for this.
GanttElastic.components... = your modified one

You can also change route dynamically
https://github.com/neuronetio/gantt-elastic/blob/master/examples/vue.edit.html#L317
just add event and push route route.push

I define the click function in events, but in the function scope vue-router doesn't work.

I'm guessing, maybe try to bind this function to proper vue instance after it was created like

created(){
  /*...*/.events.click = /*...*/.events.click.bind(this);
}

and inside click function use something like this.$router.push('...')