|
| 1 | +<template> |
| 2 | + <v-col |
| 3 | + id="components-v-inline-custom-field" |
| 4 | + class="mb-5" |
| 5 | + cols="12" |
| 6 | + > |
| 7 | + <h2 |
| 8 | + class="mb-0" |
| 9 | + :class="classes.h2" |
| 10 | + > |
| 11 | + <a |
| 12 | + :class="classes.headerA" |
| 13 | + href="#components-v-inline-custom-field" |
| 14 | + >#</a> |
| 15 | + VInlineCustomField |
| 16 | + </h2> |
| 17 | + With the <code class="ic">VInlineCustomField</code> component, you can add your own fields by using the <code |
| 18 | + class="ic" |
| 19 | + >default</code> slot. This slot has all of the settings and the <code class="ic">originalValue</code> bound to it. |
| 20 | + </v-col> |
| 21 | + |
| 22 | + <v-col cols="12"> |
| 23 | + <v-card> |
| 24 | + <v-card-title>Component using the <code class="ic">v-slider</code> field</v-card-title> |
| 25 | + <v-card-text> |
| 26 | + <v-row> |
| 27 | + <v-col |
| 28 | + class="d-flex align-top" |
| 29 | + cols="2" |
| 30 | + > |
| 31 | + <VInlineCustomField |
| 32 | + v-model="range" |
| 33 | + :loading="loading" |
| 34 | + :loading-wait="false" |
| 35 | + > |
| 36 | + <template #default=""> |
| 37 | + <v-slider |
| 38 | + v-model="range" |
| 39 | + show-ticks |
| 40 | + step="10" |
| 41 | + ></v-slider> |
| 42 | + </template> |
| 43 | + </VInlineCustomField> |
| 44 | + </v-col> |
| 45 | + |
| 46 | + <v-col cols="2"> |
| 47 | + <div> |
| 48 | + <v-slider |
| 49 | + v-model="range" |
| 50 | + show-ticks |
| 51 | + step="10" |
| 52 | + ></v-slider> |
| 53 | + </div> |
| 54 | + </v-col> |
| 55 | + </v-row> |
| 56 | + </v-card-text> |
| 57 | + </v-card> |
| 58 | + </v-col> |
| 59 | + |
| 60 | + <v-col |
| 61 | + id="inline-custom-field-props" |
| 62 | + cols="12" |
| 63 | + > |
| 64 | + <h3 :class="classes.h3"> |
| 65 | + <a |
| 66 | + :class="classes.headerA" |
| 67 | + href="#inline-custom-field-props" |
| 68 | + >#</a> |
| 69 | + Props |
| 70 | + </h3> |
| 71 | + </v-col> |
| 72 | + |
| 73 | + <v-col cols="12"> |
| 74 | + Most of the <a href="#props-shared">shared props</a> can be used with this component. The <a |
| 75 | + href="#props-save-and-loading-icon" |
| 76 | + >Save & Loading Icon</a> props will most likely be the most useful if you need them. |
| 77 | + </v-col> |
| 78 | + |
| 79 | + <v-col cols="12"> |
| 80 | + <CodeBlock |
| 81 | + class="mb-6" |
| 82 | + :code="exampleCode" |
| 83 | + :highlightjs="codeBlockSettings.plugin === 'highlightjs'" |
| 84 | + label="Basic Example" |
| 85 | + lang="html" |
| 86 | + :prismjs="codeBlockSettings.plugin === 'prismjs'" |
| 87 | + :theme="codeBlockSettings.theme" |
| 88 | + ></CodeBlock> |
| 89 | + </v-col> |
| 90 | +</template> |
| 91 | + |
| 92 | +<script setup> |
| 93 | +import { computed, inject, ref } from 'vue'; |
| 94 | +
|
| 95 | +
|
| 96 | +const props = defineProps({ |
| 97 | + codeBlockOptions: { |
| 98 | + required: true, |
| 99 | + type: Object, |
| 100 | + }, |
| 101 | +}); |
| 102 | +
|
| 103 | +const codeBlockSettings = computed(() => props.codeBlockOptions); |
| 104 | +const classes = inject('classes'); |
| 105 | +
|
| 106 | +const loading = ref(false); |
| 107 | +const range = ref(50); |
| 108 | +
|
| 109 | +const exampleCode = `<template> |
| 110 | + <VInlineCustomField |
| 111 | + v-model="range" |
| 112 | + :loading="loading" |
| 113 | + > |
| 114 | + <template #default="settings"> |
| 115 | + <v-slider |
| 116 | + v-model="range" |
| 117 | + show-ticks |
| 118 | + step="10" |
| 119 | + > |
| 120 | + </v-slider> |
| 121 | + <\/template> |
| 122 | + <\/VInlineCustomField> |
| 123 | +<\/template> |
| 124 | +
|
| 125 | +<script setup> |
| 126 | +import { ref } from 'vue'; |
| 127 | +
|
| 128 | +const range = ref(50); |
| 129 | +const loading = ref(false); |
| 130 | +<\/script>`; |
| 131 | +</script> |
| 132 | + |
| 133 | +<style lang="scss" scoped> |
| 134 | +</style> |
0 commit comments