単一ファイルコンポーネントを使用してparentのフィルタを呼び出す方法を教えてください。以下は私のコードです。親からフィルタを呼び出す方法を確認する
app.js
import computed from '../vue/mixins/computed.js';
import filters from '../vue/mixins/filters.js';
import methods from '../vue/mixins/methods.js';
const app = new Vue({
el: '#app',
mixins:[
computed,
filters,
methods
],
mounted: function() {
}
});
home.vue
<template>
<div class="home-content">
<h3>{{home | uppercase}}</h3>
</div>
</template>
<script type="text/javascript">
export default {
data: function() {
return {
home: 'home'
}
},
mounted: function() {
this.$parent.$options.methods.makeConsole();
}
}
</script>
それは私のコンソールでこの警告を与えているが、 "フィルタを解決するために失敗しました:大文字の"
可能な重複https://stackoverflow.com/questions/35266157/how-to-apply-a-filter-within-a-vuejs-component – emanek