endaaman.com

2017-12-14

Tips

vue-routerで動的なHTMLに対してrouter-linkを使いたいとき

Vueの神(Evan You)によるコメント

dynamic HTML with links · Issue #48 · vuejs/vue-router

This should work, but $compile() is pretty low-level and you need to store the returned unlink function and call them later for proper cleanup. The probably easier way is to intercept click events on a containing element, call event.preventDefault(), then call router.go() yourself.

Maybe I should add an option for global link hijacks.


©2024 endaaman.com