How to pass a string with double quoutes as property in VueJS? - vue.js

I just tried to use code like below:
<editor init-text="String "Test""></editor>
But DOM breaks because of qoutes in given string.
How to avoid that problem?

Escape the quotes with a \
<editor init-text="String \"Test\""></editor>
Or mix single ' and double " quotes
<editor init-text='String "Test"'></editor>

Related

Vuejs, what does ':' and '#' mean in vuejs?

I am new to vuejs, and I would like to know what ':' and '#' does in the context of this code?
I am unsure about if this the initial values for the module.
Thanks for any help.
Here is the code:
<appWindow
:app="activeApp"
:active="windowActive"
#closed="windowActive = false"
#removeApp="removeApp"
#resetNotes="resetNotes"
#updateCheckbox="updateCheckbox"
/>
# is synonymous to v-on:
It is used to handle Event
For more: https://v2.vuejs.org/v2/guide/events.html
<!-- these two are same -->
<button v-on:click="foo()">Button</button>
<button #click="foo()">Button</button>
: is synonymous to v-bind:
It is used to binding value to an attribute
For more: https://v2.vuejs.org/v2/api/#v-bind
<!-- these two are same -->
<img v-bind:src="imgurl">
<img :src="imgurl">
The # is shorthand for v-on
A : on a prop will make the contents evaluate as javascript rather than a string.

How can I write and ampersand in a v-input in vue?

How can I write and ampersand in a v-input in vue?
<v-input
label="Terms"
description="I agree to Terms & Conditions
type="checkbox"
:value.sync="registerDetails.terms"
:v="$v.registerDetails.terms"
/>
Try the following including using the html code for ampersand as well as correcting usage of single and double quotes:
<v-input
label="Terms"
description="I agree to <a href='/legal-information/terms-conditions' target='_blank'>Terms & Conditions</a>"
type="checkbox"
:value.sync="registerDetails.terms"
:v="$v.registerDetails.terms"
/>
Hopefully that helps!

How to assign a string and a string in the vue template?

How to assign a string and a string in the vue template?
<q-table
:title=`Lista de ${this.$route.params.tipo}`
/>
error Parsing error: Line 1: Unterminated template
It`s work
:title=' ` Lista de ${$route.params.tipo} ` '
You forgot to add quotes around the template interpolation.
:title="`Lista de ${$route.params.tipo}`"
You do not use this in templates. Actually, everything in the template gets a this automatically.
:title=`Lista de ${\$route.params.tipo}`
Or in simple form, without template string:
:title='$route.params.tipo'

How to bind v-for values to HTML attributes in Vue

I'm trying to attach the values I get from a v-for to attributes in the same tag but with no luck. Here's my code:
<label
v-for="hashtag in hashtags"
v-bind:title=`You can filter with {hashtag}`
v-bind:data-value="hashtag"
></label>
Basically the value goes to the title and data-value
your title binding should have double quotes before and after the expression, and it seems that you want a string interpolation in title, but I don't think it will work.
try this (you can ommit v-bind cus : its a shorthand for it)
<label v-for="hashtag in hashtags" :title="'You can filter with ' + hashtag" :data-value="hashtag">
{{ hashtag }}
</label>
https://jsfiddle.net/5sqs5fsq/

android:text=" "What If" " how to write this text inside (android:text) attribute,along with double quotes in Android

I am new to android, what i want is to show a button containing text including double quotes as given below...but I am getting an error as..... "Attribute is missing the Android namespace prefix"
<Button
android:id="#+id/button3"
android:background="#drawable/nxtbckbutton"
android:layout_width="wrap_content"
android:textColor="#ffffff"
android:layout_height="wrap_content"
android![enter image description here][1]:text="Continue to "What if" " />
You need to escape the double quotes by using a backslash
android:text="Continue to \"What if\" "
Another option is to use the " XML entity for the double quote symbol.
Here is a question about using double quotes in the text attribute.
android:text='Continue to "What if"'
Found it... thanx guyz...