Vue 'is' বৈশিষ্ট্য
Vue.js 'is' . , HTML Vue .
প্রধান আবেদন:
'is' বৈশিষ্ট্যটি তিনটি প্রধান জিনিসের জন্য ব্যবহৃত হয়: গতিশীল উপাদান, এইচটিএমএল উপাদানগুলিকে Vue উপাদান দিয়ে প্রতিস্থাপন করা এবং কাস্টমাইজ করা বিল্ট-ইন উপাদান।
উদাহরণ
আপনার নিজস্ব Vue সার্ভার পান
'is' অ্যাট্রিবিউটটি কম্পিউটেড মান 'activeComp'-এর সাথে v-bind (শর্টকাট:) দ্বারা সংযুক্ত থাকে যাতে হয় 'comp-one' কম্পোনেন্ট বা 'comp-টু' কম্পোনেন্ট প্রদর্শিত হয়।
App.vue:
<template>
<h1>Dynamic Components</h1>
<p>App.vue switches between which component to show.</p>
<button @click="toggleValue = !toggleValue">Switch component</button>
<component :is="activeComp"></component>
</template>
নীচে আরো উদাহরণ দেখুন.
সংজ্ঞা এবং প্রয়োগ
'is' বৈশিষ্ট্য তিনটি জিনিসের জন্য ব্যবহার করা যেতে পারে:
গুরুত্বপূর্ণ নোট:
আমরা যদি vue: উপসর্গ ব্যবহার না করি, তাহলে এটি একটি কাস্টমাইজড বিল্ট-ইন উপাদান হিসেবে ব্যাখ্যা করা হবে এবং Vue উপাদান সন্নিবেশ করা হবে না।
আরো উদাহরণ
উদাহরণ 1
'is' অ্যাট্রিবিউট ব্যবহার করে একটি Vue এলিমেন্ট দিয়ে <img> ট্যাগ প্রতিস্থাপন করা।
App.vue:
<template>
<h2>Example Built-in 'is' Attribute</h2>
<p>The IMG tag below is set to be replaced by a component by the use of 'is="vue:child-comp"'.</p>
<img is="vue:child-comp" />
</template>
ChildComp.vue:
<template>
<div>
<h3>ChildComp.vue</h3>
<p>This is the child component</p>
</div>
</template>
<style scoped>
div {
border: solid black 1px;
background-color: lightgreen;
padding: 10px;
max-width: 250px;
margin-top: 20px;
}
</style>
Vue 'is' অ্যাট্রিবিউট টিউটোরিয়াল
Vue-তে 'is' বৈশিষ্ট্য সম্পর্কে আপনার বোঝার পরীক্ষা করার জন্য এই টিউটোরিয়ালটি ব্যবহার করে দেখুন।