screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/@mdi/font@6.x/css/materialdesignicons.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css" rel="stylesheet"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"> </head> <body> <div id="app"> <v-app> <v-main> <v-container> <h3>Vuetify Clear text field using ref</h3> <v-text-field v-model="firstName" label="First Name" ref="firstNameField"></v-text-field> <v-text-field v-model="lastName" label="Last Name" ref="lastNameField"></v-text-field> <v-text-field v-model="email" label="Email" ref="emailField"></v-text-field> <v-text-field v-model="phoneNumber" label="Phone Number" ref="phoneNumberField"></v-text-field> <v-btn @click="clearFields">Clear Fields</v-btn> </v-container> </v-main> </v-app> </div> <script src="https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js"></script> <script src="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.js"></script> <script> new Vue({ el: '#app', vuetify: new Vuetify(), data() { return { firstName: 'Joe', lastName: 'root', email: 'root@gmail.com', phoneNumber: '45234245222', }; }, methods: { clearFields() { this.$refs.firstNameField.reset(); this.$refs.lastNameField.reset(); this.$refs.emailField.reset(); this.$refs.phoneNumberField.reset(); }, }, }) </script> </body> </html>