Vue has any way to don't use the shorthand or colon? this is not valid html and I have problems implementing it with React-Dom for server rendering in Node.js
Asked
Active
Viewed 1,470 times
0
-
1This is unfortunately the problem when using vue templates with an existing templating engine, a problem which Single File Components circumvent. – Abana Clara Jul 31 '19 at 08:00
-
className also isn't valid HTML attribute. You should switch to other server side rendering engine than React-Dom. Consider Nuxt.js or take a look how they do it – Emīls Gulbis Jul 31 '19 at 08:01
2 Answers
4
See https://v2.vuejs.org/v2/guide/syntax.html#v-on-Shorthand
There are 2 important shorthand notations:
<div :value="true"></div>
means <div v-bind:value="true"></div>
<div @click="myFunc"></div>
means <div v-on:click="myFunc"></div>
So you can use both interchangeably.
It might not work in your case, i have not yet tried to mix react-dom and vue together.
1
Vue 2.4.0+ syntax can be used:
<a v-on="{click:myFunc}" ...
For this syntax passive
, once
and capture
modifiers can be assigned using &
, ~
and !
prefixes correspondingly
(Event & Key Modifiers).
Other modifiers aren't implemented yet (see this issue: Extending object syntax of v-on to support modifiers #7846).