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

    q-uploader fails in a weird way

    Help
    4
    8
    2641
    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.
    • W
      wojtec last edited by

      Hey,

      I’m using quasar 0.12.0 and I’m getting this weird ‘invalid expression’ error on the following template code:
      <q-uploader :url="/comment/upload"></q-uploader>

      any ideas?

      ERROR in ./~/vue-loader/lib/template-compiler.js?id=data-v-5e449fee!./~/vue-loader/lib/selector.js?type=template&index=0!./src/components/task/TaskComments.vue
      template syntax error - invalid expression: :url="/comment/upload"
      @ ./src/components/task/TaskComments.vue 11:23-152
      @ ./src/components async ^./.*.vue$
      @ ./src/router.js
      @ ./src/main.js
      @ multi app

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        This is just a totally wild guess, but try,

        <q-uploader :url="'/comment/upload'"></q-uploader>

        Notice the single quotes.

        Scott

        1 Reply Last reply Reply Quote 0
        • rstoenescu
          rstoenescu Admin last edited by rstoenescu

          If you are specifying the url string directly (so not through a js expression) then you must not Vue bind it.

          url="/path/to/script" — notice no “:” before url attribute.

          W 1 Reply Last reply Reply Quote 0
          • s.molinari
            s.molinari last edited by

            Ah…learned something new!

            Scott

            1 Reply Last reply Reply Quote 0
            • W
              wojtec @rstoenescu last edited by

              @rstoenescu said in q-uploader fails in a weird way:

              If you are specifying the url string directly (so not through a js expression) then you must not Vue bind it.

              url="/path/to/script" — notice no “:” before url attribute.

              @rstoenescu thanks! I based it on the example in the docs which have the ‘:’ - http://quasar-framework.org/components/uploader.html

              rstoenescu 1 Reply Last reply Reply Quote 0
              • rstoenescu
                rstoenescu Admin @wojtec last edited by

                @wojtec Yes, but in that case “url” is a variable not a static string.

                W 1 Reply Last reply Reply Quote 0
                • W
                  wojtec @rstoenescu last edited by

                  @rstoenescu Ah, you’re right!

                  1 Reply Last reply Reply Quote 0
                  • P
                    pobz last edited by

                    Hello, I try to use q-uploader and I’d like to post my file in assets folder. When I configure url at ~assets the console say that localhost:8080/assets doesn’t exist. Can someone help me?

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