【发布时间】:2021-03-19 10:19:22
【问题描述】:
您好,我使用带有 express 和车把以及 vue 2.6 的 nodejs 我想将 {{audioannotationid}} 传递给我的 vue 组件,但我不能, 我做错了什么? 对不起我的英语
这是我的edit.hbs
<div> Editar audio annnotations</div>
<div id="EditAudioannotations" idParametro="beowulfdgo" >
</div>
{{audioannotationid}}
这是我的组件
<template>
<div id="EditAudioannotations" >Hola {{who}}
{{valor}}
</div>
</template>
<script>
export default {
name: 'EditAudioannotations',
props:{idParametro:{
type: String,
default: '0',
},},
data() {
return {
who:"world",
json: {},
valor:"otro valor"
};
},
methods: {
},
beforeMount() {
},
};
</script>
<style></style>
这是我的 index.js
if(window.location.pathname.match(/\/audioannotations\/edit\//)){
// window.Vue = Vue
Vue.use(VueAxios, axios);
Vue.component("EditAudioannotations", EditAudioannotations);
window.vm = new Vue({
el: '#EditAudioannotations',
render: h => h(EditAudioannotations)
})
}
【问题讨论】:
-
这个问题在stackoverflow.com/questions/36530301/…之前回答过
-
但我想将参数传递给 vue
标签: node.js vue.js handlebars.js