Home > front end >  For help on i.i sPlainObject is not a problem of the function
For help on i.i sPlainObject is not a problem of the function

Time:11-29

I just started learning Vue, today when learned Vue - the resource section, according to the tutorial has written one of the most primary test procedure, an error as a result, the younger brother checked baidu for a long time, are no answers, no resistance to seek expert help, details please see:



<meta charset="UTF-8">
<meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
Document
<script SRC="https://bbs.csdn.net/lib/vue.js" & gt; </script>//is in the official website to download the package, the latest version of that size is 335 k, path right
<script SRC="https://bbs.csdn.net/lib/vue-resource.min.js" & gt; </script>//the third party package size is 7 KB, guide package path no problem

<body>



<script>
Var=new vm Vue ({
El: '# app,
Data: {},
Methods: {
Getinfo () {

Var url="http://www.baidu.com";
The console. The log (enclosing $HTTP);
Enclosing $HTTP. Get (url). Then (function (result) {//this sentence error is
console.log(result);
})
}
}
})
</script>





The error information is as follows:
Vue. Js: 634 [vue warn] : Error in v - on handler: "TypeError: i.i sPlainObject is not a function", "

(found in & lt; Root>)
Warn @ vue. Js: 634
LogError @ vue. Js: 1893
GlobalHandleError @ vue. Js: 1888
HandleError @ vue. Js: 1848
InvokeWithErrorHandling @ vue. Js: 1871
Invoker @ vue. Js: 2188
The original. _wrapper @ vue. Js: 7547
Vue. Js: 1897 TypeError: i.i sPlainObject is not a function
The at Vue. R (Vue - resource. Min. Js: 1)
Ats Function. R. & lt; computed> As [get] (vue - resource. Min. Js: 1)
The at Vue. Getinfo (nettest. HTML: 25)
At the click (eval at createFunction (vue. Js: 11649), & lt; Anonymous> : 3:13 5)
The at invokeWithErrorHandling (vue. Js: 1863)
The at HTMLInputElement. Invoker (vue. Js: 2188)
The at HTMLInputElement. The original. _wrapper (vue. Js: 7547)
LogError @ vue. Js: 1897
GlobalHandleError @ vue. Js: 1888
HandleError @ vue. Js: 1848
InvokeWithErrorHandling @ vue. Js: 1871
Invoker @ vue. Js: 2188
The original. _wrapper @ vue. Js: 7547

CodePudding user response:

You the enclosing $HTTP is where come of, this should be a packaging request method, didn't see you have introduced related js file,

CodePudding user response:

In front of the import packages & lt; Script SRC="https://bbs.csdn.net/lib/vue-resource.min.js" & gt; </script> , you said this method is that the package provides
  • Related