0
我有一個頁面,其中字段名稱的類型是數組。在Vuejs中用括號指定數據的最佳方法是什麼?
eg. mapping[map][email_address][type]
現在Vue公司,我想設置的默認值,我做如下
new Vue({
el: '#configure',
data: {
mapping: {
map: {
email_address: {
type: 'incoming_field'
}
}
}
}
})
但我在控制檯得到一個錯誤
[Vue warn]: Property or method "map" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.
vue.js:569 [Vue warn]: Property or method "email_address" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.
vue.js:569 [Vue warn]: Error in render function:
(found in <Root>)
什麼在Vuejs中處理這些字段名稱的最佳方法是什麼?