primevue-mirror/pages/rating/index.vue

64 lines
1.9 KiB
Vue
Raw Normal View History

2022-09-09 20:41:18 +00:00
<template>
<div>
<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>
2022-12-09 07:52:51 +00:00
<img src="/demo/images/rating/cancel.png" height="24" width="24" />
2022-12-08 12:26:57 +00:00
</template>
<template #onicon>
2022-12-09 07:52:51 +00:00
<img src="/demo/images/rating/custom-onicon.png" height="24" width="24" />
2022-12-08 12:26:57 +00:00
</template>
<template #officon>
2022-12-09 07:52:51 +00:00
<img src="/demo/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>