select component is undefined using jquery

Get help with using Metro 4 components
Post Reply
kanukawa
Posts: 2
Joined: Mon Apr 22, 2019 11:32 am
Status: Offline

select component is undefined using jquery

Post by kanukawa » Mon Apr 22, 2019 11:36 am

$('#select').data('select') is undefined

$('#select') is found but after data('select') is undefined

User avatar
olton
Site Admin
Posts: 233
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Mon Apr 22, 2019 11:47 am

Show your select element code

kanukawa
Posts: 2
Joined: Mon Apr 22, 2019 11:32 am
Status: Offline

Post by kanukawa » Mon Apr 22, 2019 12:22 pm

I'm working on VueJs

Template code

Code: Select all

<select id="select" data-role="select">
</select>
Javascript code

Code: Select all

mounted() {
    const select = $('#select').data('select')
    console.log(select) // undefined
}

User avatar
olton
Site Admin
Posts: 233
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Mon Apr 22, 2019 2:19 pm


Post Reply