2022-09-09 20:41:18 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
2022-12-19 11:57:07 +00:00
|
|
|
<Head>
|
|
|
|
<Title>Vue Rating Component</Title>
|
|
|
|
<Meta name="description" content="Rating component is a star based selection input." />
|
|
|
|
</Head>
|
|
|
|
|
2022-09-09 20:41:18 +00:00
|
|
|
<div class="content-section introduction">
|
|
|
|
<div class="feature-intro">
|
|
|
|
<h1>Rating</h1>
|
|
|
|
<p>Rating component is a star based selection input.</p>
|
|
|
|
</div>
|
|
|
|
<AppDemoActions />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="content-section implementation">
|
|
|
|
<div class="card">
|
|
|
|
<h5>Basic {{ val1 }}</h5>
|
2022-12-08 12:26:57 +00:00
|
|
|
<Rating v-model="val1" />
|
2022-09-09 20:41:18 +00:00
|
|
|
|
|
|
|
<h5>Without Cancel</h5>
|
2022-12-08 12:26:57 +00:00
|
|
|
<Rating v-model="val2" :cancel="false" />
|
2022-09-09 20:41:18 +00:00
|
|
|
|
|
|
|
<h5>ReadOnly</h5>
|
2022-12-08 12:26:57 +00:00
|
|
|
<Rating :modelValue="5" :readonly="true" :stars="10" :cancel="false" />
|
2022-09-09 20:41:18 +00:00
|
|
|
|
|
|
|
<h5>Disabled</h5>
|
2022-12-08 12:26:57 +00:00
|
|
|
<Rating :modelValue="8" :disabled="true" :stars="10" />
|
|
|
|
|
|
|
|
<h5>Custom Icons</h5>
|
|
|
|
<Rating v-model="val3" :stars="5" onIcon="pi pi-heart-fill" offIcon="pi pi-heart" cancelIcon="pi pi-times" />
|
|
|
|
|
|
|
|
<h5>Templating</h5>
|
|
|
|
<Rating v-model="val4">
|
|
|
|
<template #cancelicon>
|
2023-02-06 14:59:12 +00:00
|
|
|
<img src="https://primefaces.org/cdn/primevue/images/rating/cancel.png" height="24" width="24" />
|
2022-12-08 12:26:57 +00:00
|
|
|
</template>
|
|
|
|
<template #onicon>
|
2023-02-06 14:59:12 +00:00
|
|
|
<img src="https://primefaces.org/cdn/primevue/images/rating/custom-onicon.png" height="24" width="24" />
|
2022-12-08 12:26:57 +00:00
|
|
|
</template>
|
|
|
|
<template #officon>
|
2023-02-06 14:59:12 +00:00
|
|
|
<img src="https://primefaces.org/cdn/primevue/images/rating/custom-officon.png" height="24" width="24" />
|
2022-12-08 12:26:57 +00:00
|
|
|
</template>
|
|
|
|
</Rating>
|
2022-09-09 20:41:18 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<RatingDoc />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import RatingDoc from './RatingDoc';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
val1: null,
|
2022-12-08 12:26:57 +00:00
|
|
|
val2: 3,
|
|
|
|
val3: 2,
|
|
|
|
val4: 2
|
2022-09-09 20:41:18 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
RatingDoc: RatingDoc
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|