低調的D吖 2019-11-12 16:23 采纳率: 0%
浏览 817

el-radio 點擊事件無法生效原因

 <el-radio v-model="numbering" label="1" v-on:click="fn()">A</el-radio>

 <el-row :gutter="5" v-if="willShow" >
                    <el-col>
                        <el-form-item label="料号" prop="materialNumber" v-bind:rules='[{required : true ,message : "名称不能为空"}]'>
                            <el-input v-model="materialNumber"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
new Vue({
                el: '#app',

                data: {

                    willShow: false
                                        },

                        methods:{               
                                         fn: function (){
                        if (this.willShow == true){
                            this.willShow = false;
                     }else {
                            this.willShow = true;
                     }
                    },
                                        }
  • 写回答

1条回答 默认 最新

  • zhshchilss 2019-11-12 17:06
    关注

    v-on:click="fn()" --》 v-on:click="fn"

    评论

报告相同问题?