現在vue.jsの勉強中です。
importしたvueを後から別のvueで上書きし、コンテンツを変更したいのですが、
調べてもやり方が分からなかったのでお教え頂けたら幸いです。。。
↓Item_1.vueをItem_2.vueで上書きしたい
vue
1<template> 2 <div class="home"> 3 <Item /> 4 <button @click="BtnClick()">ボタン</button> 5 </div> 6</template> 7 8<script> 9import Item from "@/components/item/Item_1.vue"; 10 11export default { 12 name: "home", 13 components: { 14 Item 15 }, 16 methods: { 17 BtnClick: function() { 18 // Item = "@/components/item/Item_2.vue"のコンポーネントで上書きしてコンテンツ内容を変更したい 19 } 20 } 21}; 22</script> 23
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/01/30 07:58