beginners of vue, do not want to use vue-cli and webpack, but the introduction of vue.js will report errors, and there are also dependencies in package. The compiler does not report errors, but the browser reports Uncaught SyntaxError: Unexpected identifier
.
webstorm
js Code:
import Vue from "vue"
import Resource from "vue-resource"
import {AsyncComponent as reject } from "vue"
import {AsyncComponent as resolve} from "vue"
Vue.use(Resource);
var vm = new Vue({
el: "-sharpapp",
data: {
adminName:"",
password:"",
message:"",
url:"localhost:8080/ssm/admin/find",
id:1
},
methods: {
submit: function () {
this.message="";
var params=new Object();
params.name=this.adminName;
Vue.http.get(
this.url,
{
params: params
},
{emulateJSON: true}
)
.then((success) => {
resolve(success);
})
.catch((error) => {
reject(error);
});
}
}
});