how to get attr in vuejs
<script src="https://unpkg.com/vue"></script>
<div id="app">
<my-comp my-attr="Any value"></my-comp>
</div>
<script>
Vue.component('my-comp', {
template: '<div>aaa</div>',
created: function () {
console.log(this.$attrs['my-attr']) // And here is - in $attrs object
}
})
new Vue({
el: '#app'
})
</script>
Also in JavaScript:
- how get checkbox if checked in jquery
- hidden jquery
- react multiple select dropdown
- timestamp to date javascript
- digit count in javascript
- Declarative Functions
- react js http post 500 internal server error
- moment get timezone
- plus minus hackerrank solution javascript
- $ is not defined jquery
- for each array javascript
- vuejs typescript mapactions
- get height of div use js
- Encryption RSA, JavaScript
- can we use two versions of jquery in same page
- react native status bar
- import react component
- regex for ip address javascript
- javascript replace newline with br
- javascript delete cookie
- getting value from radio button javascript
- javascript save data to local storage
- navigation in react native
- font awesome react