我希望将数组的索引index赋值给data-article-id这个属性,请问如何实现?
:key="index"
@click="openNewPage($event)"
data-article-id='index'
ref="dataMsg"
>
{{item}}
export default {
data() {
return {
introduce: "自我介绍",
work: '工作经历',
experiences: '经验心得页面',
hobby: '业余爱好',
titleList: [
'js防抖和节流',
'2019年最新经典web前端面试题',
'手把手教你用npm发布包'
]
}
},
methods: {
openNewPage: function(e) {
let \_self = this;
console.log('$refs == ',e.target.dataset.articleId)
}
},
beforeCreate: function () {
console.log('列表-初始化')
},
created: function() {
},
beforeMount: function() {
},
mounted: function() {
},
beforeUpdate: function() {
},
updated: function() {
},
beforeDestroy: function() {
},
destroyed: function() {
}
}