Home > front end >  Using local create components bind variables within the template error
Using local create components bind variables within the template error

Time:10-04

Business requirements is that he want the page to write h5 page code and I take back the code from the background rendering up he write functions can call I think write code directly with local registered components behind if the template can be normal use but the code needs to take back from the background creates a component bindings in the template but using local variable error I also use a v - HTML method v - HTML doesn't recognize v - HTML script tag event can trigger the function outside

 & lt; Template> 

I am a parent component





<script>
The import Vue from 'Vue'
Var MyComponent=Vue. The extend ({
Data: the function () {
Return {
UrlId: "'
JsContent: "'
HTML: ` & lt; A @ click="show (1)" & gt; I am the Lord & lt;/a> `
}
},
The template: this HTML,
Methods: {
Show (I) {
The console. The log (I)
}
}
})
Var component=new MyComponent () $mount ()
Export the default {
Data () {
Return {
}
},
Methods: {
},
Mounted () {
Document. The getElementById (' parent '). The appendChild (component. $el)
}
}
</script>
  • Related