Marked: When used in vue.js

Created on 19 May 2016  路  3Comments  路  Source: markedjs/marked

route.js:72Uncaught TypeError: Cannot read property 'replace' of undefined
Please report this to https://github.com/chjj/marked.

webpack

var marked = require("marked")

Vue.filter('marked',marked)

Most helpful comment

All 3 comments

I think the second argument of the .filter() method has to be a function that transforms the input:

Vue.filter('marked', function(input){
  return marked(input)
})

Thks, I know why i not work , i have try Vue.filter('marked',function(input){ return marked(input); }); and filters:{ marked : marked } . All works , beause the templates <div> {{{input | marked}}} </div> input is undefined in the component , defined it in component data ,so fixed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

camwiegert picture camwiegert  路  4Comments

FireflyAndStars picture FireflyAndStars  路  3Comments

cusalvi picture cusalvi  路  3Comments

priyesh-diukar picture priyesh-diukar  路  3Comments

pigtooter picture pigtooter  路  4Comments