primevue-mirror/doc/knob/ReactiveDoc.vue

68 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>
<div class="card flex flex-column align-items-center gap-2">
<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" />
</div>`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card flex flex-column align-items-center gap-2">
<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
}
}
};
<\/script>`,
2023-09-22 12:54:14 +00:00
composition: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card flex flex-column align-items-center gap-2">
<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);
<\/script>`
}
};
}
};
</script>