primevue-mirror/doc/selectbutton/DisabledDoc.vue

77 lines
2.3 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>When <i>disabled</i> is present, the element cannot be edited and focused entirely. Certain options can also be disabled using the <i>optionDisabled</i> property.</p>
</DocSectionText>
2024-05-20 12:14:38 +00:00
<div class="card flex flex-wrap justify-center flex-wrap gap-4">
2023-02-28 08:29:30 +00:00
<SelectButton v-model="value" :options="options1" disabled />
<SelectButton v-model="value2" :options="options2" optionDisabled="constant" optionLabel="name" />
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
value: 'Off',
value2: null,
options1: ['Off', 'On'],
options2: [
{ name: 'Option 1', value: 1, constant: false },
{ name: 'Option 2', value: 2, constant: true }
],
code: {
2023-09-22 12:54:14 +00:00
basic: `
<SelectButton v-model="value" :options="options" disabled />
2023-10-15 09:38:39 +00:00
<SelectButton v-model="value" :options="options2" optionDisabled="constant" optionLabel="name" />
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2024-05-20 12:14:38 +00:00
<div class="card flex flex-wrap justify-center flex-wrap gap-4">
2023-02-28 08:29:30 +00:00
<SelectButton v-model="value" :options="options" disabled />
<SelectButton v-model="value" :options="options2" optionDisabled="constant" optionLabel="name" />
</div>
</template>
<script>
export default {
data() {
return {
value: 'Off',
value2: null,
options1: ['Off', 'On'],
options2: [
2023-10-18 11:11:32 +00:00
{ name: 'Option 1', value: 1, constant: false },
2023-02-28 08:29:30 +00:00
{ name: 'Option 2', value: 2, constant: true }
]
}
}
};
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-wrap justify-center flex-wrap gap-4">
2023-02-28 08:29:30 +00:00
<SelectButton v-model="value" :options="options" disabled />
<SelectButton v-model="value" :options="options2" optionDisabled="constant" optionLabel="name" />
</div>
</template>
<script setup>
import { ref } from 'vue';
const value1 = ref('Off');
const value2 = ref();
const options1 = ref(['Off', 'On']);
const options2 = ref([
2023-10-18 11:11:32 +00:00
{ name: 'Option 1', value: 1, constant: false },
2023-10-18 11:09:13 +00:00
{ name: 'Option 2', value: 2, constant: true }
]);
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>