How to use vue to get the self-defined attribute of a html sign? (如何用vue获取自定义属性?)

I have tried two methods as follow, but they do not work…(我已经尝试了两种办法但是不好用)

method1(方法一):
code(代码):
<el-menu-item index=“1” data-type=“1” @click=“chooseType($event)”>

e.currentTarget.getAttribute(‘data-type’)

error(报错):
Cannot read property ‘getAttribute’ of undefined

and method2(方法二):

code(代码):
<el-menu-item index=“1” data-type=“1” @click=“chooseType” ref=“dataType”>

this.$refs.dataType.dataset.type

error(报错):
Cannot read property ‘type’ of undefined"

come on, i need your help, and thanks!(求大佬解答!!!)

el-menu-item is a vue element not a dom element

the below only works on a dom element
e.currentTarget.getAttribute(‘data-type’)

yes, u are right! thank u very much