You can do this:
class YourComponent extends Vue {
$refs!: {
checkboxElement: HTMLFormElement
}
someMethod () {
this.$refs.checkboxElement.checked
}
}
From this issue: https://github.com/vuejs/vue-class-component/issues/94
More Related Contents:
- How to add external JS scripts to VueJS Components?
- Communication between sibling components in Vue.js 2.0
- [Vue warn]: Property or method is not defined on the instance but referenced during render
- How to listen for ‘props’ changes
- Passing props dynamically to dynamic component in VueJS
- Is there any way to ‘watch’ for localstorage in Vuejs?
- VueJS/Typescript – Cannot find module ‘./components/Navigation’ or its corresponding type declarations
- Vue v-on:click does not work on component
- Vue template or render function not defined yet I am using neither?
- Global data with VueJs 2
- Property ‘XXX’ does not exist on type ‘CombinedVueInstance’
- When should I use Vuex?
- Vue.js – Add class to clicked button
- Use arrow function in vue computed does not work
- How to use .env variables in Nuxt 2 or 3?
- Vue 2 – Mutating props vue-warn
- VueJS: why is “this” undefined?
- Make VueJS and jQuery play nice
- Vue.js – How to properly watch for nested data
- VueJs 2.0 emit event from grand child to his grand parent component
- Vuex state on page refresh
- Can I pass parameters in computed properties in Vue.Js
- Vue – Deep watching an array of objects and calculating the change?
- How to call function on child component on parent events
- Vue JS: Difference of data() { return {} } vs data:() => ({ })
- Access vue instance/data inside filter method
- Parentheses while calling a method in Vue
- Vue.js – update router view
- Detect Back Button in Navigation Guards of Vue-Router
- What’s the correct way to pass props as initial data in Vue.js 2?