forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClearable.vue
More file actions
26 lines (24 loc) · 716 Bytes
/
Clearable.vue
File metadata and controls
26 lines (24 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<template>
<div class="q-pa-md">
<div class="q-gutter-y-md column" style="max-width: 300px">
<q-field color="orange" filled v-model="text" label="Label" stack-label clearable>
<template v-slot:control>
<div class="self-center full-width no-outline" tabindex="0">Text is <q>{{text === null ? 'null' : text}}</q></div>
</template>
<template v-if="text === null" v-slot:append>
<q-icon name="short_text" @click.stop="text = 'Some text'" class="cursor-pointer" />
</template>
</q-field>
</div>
</div>
</template>
<script>
import { ref } from 'vue'
export default {
setup () {
return {
text: ref('Some text')
}
}
}
</script>