q-uploader fails in a weird way
-
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 -
This is just a totally wild guess, but try,
<q-uploader :url="'/comment/upload'"></q-uploader>
Notice the single quotes.
Scott
-
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. -
Ah…learned something new!
Scott
-
@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
-
@wojtec Yes, but in that case “url” is a variable not a static string.
-
@rstoenescu Ah, you’re right!
-
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?