primevue-mirror/apps/showcase/doc/knob/ReactiveDoc.vue

71 lines
1.8 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Knob can be controlled with custom controls as well.</p>
</DocSectionText>
2024-05-20 12:14:38 +00:00
<div class="card flex flex-col items-center gap-2">
2023-02-28 08:29:30 +00:00
<Knob v-model="value" :size="150" readonly />
<div class="flex gap-2">
<Button icon="pi pi-plus" @click="value++" :disabled="value >= 100" />
<Button icon="pi pi-minus" @click="value--" :disabled="value <= 0" />
</div>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
value: 0,
code: {
2023-09-22 12:54:14 +00:00
basic: `
<Knob v-model="value" :size="150" readonly />
2023-02-28 08:29:30 +00:00
<div class="flex gap-2">
<Button icon="pi pi-plus" @click="value++" :disabled="value >= 100" />
<Button icon="pi pi-minus" @click="value--" :disabled="value <= 0" />
2023-10-15 09:38:39 +00:00
</div>
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2024-05-20 12:14:38 +00:00
<div class="card flex flex-col items-center gap-2">
2023-02-28 08:29:30 +00:00
<Knob v-model="value" :size="150" readonly />
<div class="flex gap-2">
<Button icon="pi pi-plus" @click="value++" :disabled="value >= 100" />
<Button icon="pi pi-minus" @click="value--" :disabled="value <= 0" />
</div>
</div>
</template>
<script>
export default {
data() {
return {
value: 0
}
}
};
2023-10-15 09:38:39 +00:00
<\/script>
`,
2023-09-22 12:54:14 +00:00
composition: `
<template>
2024-05-20 12:14:38 +00:00
<div class="card flex flex-col items-center gap-2">
2023-02-28 08:29:30 +00:00
<Knob v-model="value" :size="150" readonly />
<div class="flex gap-2">
<Button icon="pi pi-plus" @click="value++" :disabled="value >= 100" />
<Button icon="pi pi-minus" @click="value--" :disabled="value <= 0" />
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
const value = ref(0);
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>