search

Home  >  Q&A  >  body text

javascript - What do "HTML template" and "string template" in the vue document mean?

In the component naming convention chapter of the Vue official document, "HTML template" and "String template" are mentioned. What do they mean specifically?

伊谢尔伦伊谢尔伦2724 days ago773

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-06-15 09:25:18

    HTML Template

    HTML template should refer to native HTML, mounted to the Vue instance through el. As mentioned in the DOM-Template Parsing Instructions chapter, there are some limitations of HTML template parsing

    <table>
      <my-row>...</my-row>
    </table>

    https://jsfiddle.net/hugaungj...

    String Template

    ie JavaScript inline template string

    Vue.component('my-component', {
      template: '<p>A custom component!</p>'
    })

    They don’t refer to the same thing.

    reply
    0
  • Cancelreply