第一种(字符串模板写法):
直接写在vue构造器里,这种写法比较直观,适用于html代码不多的场景,但是如果模板里html代码太多,不便于维护,不建议这么写.
<!DOCTYPE html><html> <!-- WARNING! Make sure that you match all Quasar related tags to the same version! (Below it's "@1.7.4") --> <head> <!-- <link href="https://cdn.jsdelivr.net/npm/quasar@1.7.4/dist/quasar.min.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="stylesheet" type="text/css"> --> <link href="https:///wp-content/uploads/2020/06/quasar.umd@1.7.4.js"></script> <script> new Vue({ el: '#q-app', data: function () { return { version: Quasar.version } }, template: '#template1' // ...etc }) </script> </body></html>以上就是vue中template的三种写法示例的详细内容,更多关于vue template的资料请关注其它相关文章!