No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to use 'new vue' in Quasar

    Help
    2
    3
    681
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      Oxar last edited by

      Hi there,

      I have just started learning the Quasar framework.
      I am trying to build a simple dynamic table with editable fields and rows that can be added and removed. I am doing this incrementally.
      I have been playing with code that I found on the net written in vue.js.
      In this code a new instance of vue is created. to initialise
      var vm = new Vue({
      el: ‘#app’,
      data: {
      rows: [
      {id: 1, name: ‘Rad’, cot: ‘lomdn’, instn: ‘mA’}

      etc…

      In my <script>, I have been trying the following
      export default{
      el: ‘#testapp1’,
      data () {
      return {
      rows: [
      {id: 1, name: ‘Rad’, cot: ‘lomdn’, instn: ‘mA’}

      When I build , I get a blank screen with only the layout displayed correctly.
      Is this the correct way to achieve this? How do I create a new vue in the Quasar framework? I have gone through the guides on the website but haven’t found an answer. Any guidance is appreciated.

      Thanks,
      A

      1 Reply Last reply Reply Quote 0
      • B
        brunomeurer last edited by brunomeurer

        Hello Oxar,

        The new Vue make a new instance of vue and we must created just only once. The quasar framework already make this for us and you should not worry about that. Your scructure is ok, but you dont have <template></template> or <style></style> like this:

        <template>
          <div v-for="(item, index) in rows" :key="index">
             {{item.name}}
          </div>
        </template>
        
        <script>
        export default {
          data () {
            return {
              rows: [
                {id: 1, name: ‘Rad’, cot: ‘lomdn’, instn: ‘mA’}
              }
            }
          }
        }
        </script>
        
        <style>
        
        </style>
        

        Regards,
        Bruno Meurer

        1 Reply Last reply Reply Quote 0
        • O
          Oxar last edited by

          Thanks Bruno. That helped.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post