【发布时间】:2019-11-17 01:33:49
【问题描述】:
我想在单击按钮时显示其他组件,当然我也想发送参数,我该怎么做?
我只知道 vue 中的基本用法导入,这里是我创建的。
这里是我的模板父级
<template>
<div class="detail-project">
<selectpersons></selectpersons>
</div>
<button v-on:click="selectPerson(param1, param2)"></button>
</template>
这是我的脚本
import selectpersons from './ActionDetailProject/selectPerson.vue';
export default {
components: {
selectpersons
},
methods: {
selectPerson(param1, param2){
//not sure what i have to write here...
},
}
使用此代码,无需单击按钮即可显示组件,我想在单击按钮时显示组件selectpersons
【问题讨论】:
标签: javascript vue.js vuejs2 vue-component