0
通常你送的道具像這樣Vuejs 2發送道具xxx.vue文件
Vue.component('child', {
// camelCase in JavaScript
props: ['myMessage'],
template: '<span>{{ myMessage }}</span>'
})
如何與實現要求:
Vue.component('lw-login', require('./components/login.vue'));
Laravel刀片模板:
<lw-login
heading="Login"
action="{{ route('login') }}"
email="E-mailadres"
passwordrequest="{{ route('password.request') }}"
></lw-login>
login.vue: 請參閱{{標題}} 我收到此錯誤:
[Vue warn]: Property or method "heading" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.
(位於C發現:\代碼\ CMS \資源\資產\ JS \分量\ login.vue)
<template>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">{{ heading }}</div>
<div class="panel-body">
<form class="form-horizontal" role="form" method="POST" :action="action">
etc .....
<script>
export default {
mounted() {
props: ['heading','action','passwordrequest']
}
}
</script>
不是'./ components/login.vue'包含一個vue組件,它可以有p ROPS? –
我通過模板發送它們,添加到我的問題中。 – Bas
你的模板已經包含'lw-login'?不應該是其他標籤? –