FranckFreiburger / http-vue-loader

load .vue files from your html/js
MIT License
1.48k stars 273 forks source link

does it can use props like this <my-component :xxx="xxx"></my-component> #93

Open x13872140520 opened 4 years ago

x13872140520 commented 4 years ago

in html image image

in vue components

image image

but! it doesnt work , the result is nothing

lanyizi commented 4 years ago

@x13872140520 That doesn't look like to be a problem related to http-vue-loader. In template / html, you should write your props in snake-case.

From Vue Documentation:

HTML attribute names are case-insensitive, so browsers will interpret any uppercase characters as lowercase. That means when you’re using in-DOM templates, camelCased prop names need to use their kebab-cased (hyphen-delimited) equivalents.

Something like this:

<my-component :current-post-url="currentPostUrl" />