// markdownvue
fs.readFile(file, "utf-8", function (err, data) {
if (err) {
throw err
}
let body = marked(data,{renderer: renderer})
let innerHtml = "<template>" +
"<div class="content-wrapper text-left">" +
body +
"</div>" +
"</template>"
fs.writeFile(distpath, innerHtml, function (err) {
if (err) {
throw err
}
spinner.stop("")
})
})
I read readme.md and add < template > < / template > to the outside to become a vue component, but if I use {{xx}} in readme, the converted vue component will report an error, showing Property or method "xx" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, is not defined in the data of vue components. How to solve this problem?