vue render html raw
<p>Using mustaches: {{ rawHtml }}</p>
<p>Using v-html directive: <span v-html="rawHtml"></span></p>
vue render html raw
<p>Using mustaches: {{ rawHtml }}</p>
<p>Using v-html directive: <span v-html="rawHtml"></span></p>
vue js data bind
// with v=bind
<p><a v-bind:href="website">Text goes here fo the link </a> </p>
//or with :
<p><a :href="website">Text goes here fo the link </a> </p>
//website is variable/property with link in a Vue instance
v-bind
<div v-bind:class="{ active: isActive }"></div>
The above syntax means the presence of the active class will be determined by the truthiness of the data property isActive.
vue binding
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>
<title>JS Bin</title>
</head>
<body>
<div id="appRoot">
<template>
<button
:disabled="disabled ? false : true"
:style="{color: disabled ? 'blue' : 'red'}"
:class="[background, text]"
>{{ disabled ? "active" : "not active" }}</button>
</template>
</div>
</body>
<script>
new Vue({
name: "app",
el: "#appRoot",
data() {
return {
disabled: true,
background: "bg-success",
text: "text-white"
}
}
})
</script>
</html>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us