Home > front end >  Vue typescript
Vue typescript

Time:12-12

Vue + typescript parent components and subcomponents reported the Error in the callback for watcher "value" : "TypeError: always read the property 'call' of undefined" oh how to solve

CodePudding user response:

Object does not exist,,

CodePudding user response:

I like the ah is Boolean

CodePudding user response:

Post code... Look at the code

CodePudding user response:

The parent component


Subcomponents


<script lang="ts" & gt;
The import {Component, Prop, Watch,} the from 'vue - property - decorators';
The import {PlainView} from '@/SDK/components/PlainView';

@ Component ({})
Export the default class OnLineBuyDialog extends PlainView {
@ Prop ({required: false, the default: false})
Public value! : Boolean;
@ Prop ({required: false, the default: '})
Public courseTitle! : string;
@ Prop ({required: false, the default: '})
Public coursePrice! : string;

Private showBuy: Boolean=false;

@ Watch (' value ')
Public onShow (val: Boolean) {
Enclosing showBuy=val;
}

Public created () {
Enclosing showBuy=!!!!! This. The value;
}





</script>


CodePudding user response:

Listening test under other values, the question of whether or not to value is the keyword, inside the component shows a {{value}}

CodePudding user response:

I tried, with other variables by value elsewhere, too, so I didn't open components, write directly in a page

CodePudding user response:

Can you add your WeChat
  • Related