class 3: vue.js 3 计算属性

  • 计算属性是一种Options API,Options API是一种通过对象定义属性、方法等框架API的方式
  • 我们知道,在模板中可以直接通过插值语法显示一些data属性中的数据。但是在某些情况下,可能需要对数据进行一些转化操作之后再显示,或者需要将多个数据结合起来进行显示
  • 如果我们需要对多个data数据进行运算或由三元运算符来决定结果,或者对数据进行某种转化,然后显示结果。在模板中直接使用表达式,可以很方便的实现这些功能。但如果在模板中放入太多的逻辑,会让模板过重和难以维护;如果多个地方都使用相同逻辑,会有大量重复代码,不利于代码的复用,因此,应该尽可能将模板中的逻辑抽离出去。这样有两种解决办法,第一种是将逻辑抽取到方法中,放到methods的选项中,但是这样的话,所有data中数据的使用过程都变成了一个方法的调用,所以比较好的解决方法就是使用计算属性(computed)

下面是一个多种方案实现同一个需求的具体案例,可以比较一下

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app"></div>
    <template id="my-app">
<!--        模板语法-->
        <h3>模板语法</h3>
        <h4>{
  
  { firstName + " " + lastName }}</h4>
        <h4>{
  
  { score >= 60 ? '及格' : '不及格' }}</h4>
        <h4>{
  
  { message.split(" ").reverse().join(" ") }}</h4>
        -------------
        <!--        methods-->
        <h3>methods</h3>
        <h4>{
  
  { getFullName() }}</h4>
        
[Vue warn]: Property or method "startPoint" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties. found in ---> <Index> at src/views/largeScreen/SpecialLine/index.vue <App> at src/views/App.vue <Root> warn$2 @ vue.js:4857 warnNonPresent_1 @ vue.js:628 get @ vue.js:661 render @ index.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options:529 Vue._render @ vue.js:2368 updateComponent @ vue.js:2891 Watcher.get @ vue.js:3975 Watcher @ vue.js:3965 mountComponent @ vue.js:2912 Vue.$mount @ vue.js:8761 Vue.$mount @ vue.js:11122 init @ vue.js:4652 merged @ vue.js:4814 createComponent @ vue.js:6205 createElm @ vue.js:6167 patch @ vue.js:6647 Vue._update @ vue.js:2791 updateComponent @ vue.js:2891 Watcher.get @ vue.js:3975 Watcher @ vue.js:3965 mountComponent @ vue.js:2912 Vue.$mount @ vue.js:8761 Vue.$mount @ vue.js:11122 init @ vue.js:4652 createComponent @ vue.js:6205 createElm @ vue.js:6167 patch @ vue.js:6647 Vue._update @ vue.js:2791 updateComponent @ vue.js:2891 Watcher.get @ vue.js:3975 Watcher @ vue.js:3965 mountComponent @ vue.js:2912 Vue.$mount @ vue.js:8761 Vue.$mount @ vue.js:11122 init @ vue.js:4652 createComponent @ vue.js:6205 createElm @ vue.js:6167 patch @ vue.js:6678 Vue._update @ vue.js:2791 updateComponent @ vue.js:2891 Watcher.get @ vue.js:3975 Watcher @ vue.js:3965 mountComponent @ vue.js:2912 Vue.$mount @ vue.js:8761 Vue.$mount @ vue.js:11122 Vue._init @ vue.js:4479 Vue @ vue.js:5454 eval @ main.js:224 ./src/views/main.js @ main.js:1252 __webpack_require__ @ main.js:5626 (匿名) @ main.js:5626 __webpack_require__.O @ main.js:5626 (匿名) @ main.js:5626 (匿名) @ main.js:5626 main.js:224 [Vue warn]: Property or method "endPoint" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties. found in ---> <Index> at src/views/largeScreen/SpecialLine/index.vue <App> at src/views/App.vue <Root>
07-13
<div class="info" v-if="addressList.length"> <div v-for="(item) in addressList" :key="item.address_id"> <div class="info-content"> <span class="name">{{item.name}}</span> <span class="mobile">{{item.phone}}</span> </div> <div class="info-address"> {{item.province}} {{item.city}} {{item.region}} </div> </div> </div>报错:main.js:11 [Vue warn]: Property or method "addressList" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties. found in ---> <PayIndex> at src/views/Pay/index.vue <App> at src/App.vue <Root> warn @ vue.runtime.esm.js:4482 warnNonPresent_1 @ vue.runtime.esm.js:5082 get @ vue.runtime.esm.js:5115 render @ index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/views/Pay/index.vue?vue&type=template&id=cd080b3e&scoped=true:30 Vue._render @ vue.runtime.esm.js:2649 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6737 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 eval @ main.js:11 ./src/main.js @ app.js:792 __webpack_require__ @ app.js:1482 (匿名) @ app.js:2593 __webpack_require__.O @ app.js:1524 (匿名) @ app.js:2594 (匿名) @ app.js:2596 显示另外 33 个框架 收起 main.js:11 [Vue warn]: Error in render: "TypeError: Cannot read properties of undefined (reading &#39;length&#39;)" found in ---> <PayIndex> at src/views/Pay/index.vue <App> at src/App.vue <Root> warn @ vue.runtime.esm.js:4482 logError @ vue.runtime.esm.js:2985 globalHandleError @ vue.runtime.esm.js:2981 handleError @ vue.runtime.esm.js:2949 Vue._render @ vue.runtime.esm.js:2651 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6737 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 eval @ main.js:11 ./src/main.js @ app.js:792 __webpack_require__ @ app.js:1482 (匿名) @ app.js:2593 __webpack_require__.O @ app.js:1524 (匿名) @ app.js:2594 (匿名) @ app.js:2596 显示另外 33 个框架 收起 main.js:11 TypeError: Cannot read properties of undefined (reading &#39;length&#39;) at Proxy.render (index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/views/Pay/index.vue?vue&type=template&id=cd080b3e&scoped=true:30:28) at Vue._render (vue.runtime.esm.js:2649:22) at VueComponent.updateComponent (vue.runtime.esm.js:3769:21) at Watcher.get (vue.runtime.esm.js:3363:27) at new Watcher (vue.runtime.esm.js:3353:47) at mountComponent (vue.runtime.esm.js:3790:3) at Vue.$mount (vue.runtime.esm.js:8323:10) at init (vue.runtime.esm.js:4277:13) at merged (vue.runtime.esm.js:4439:5) at createComponent (vue.runtime.esm.js:6264:9) logError @ vue.runtime.esm.js:2989 globalHandleError @ vue.runtime.esm.js:2981 handleError @ vue.runtime.esm.js:2949 Vue._render @ vue.runtime.esm.js:2651 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6737 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 eval @ main.js:11 ./src/main.js @ app.js:792 __webpack_require__ @ app.js:1482 (匿名) @ app.js:2593 __webpack_require__.O @ app.js:1524 (匿名) @ app.js:2594 (匿名) @ app.js:2596 显示另外 32 个框架 收起
07-11
permission.js:52 [vxe-table v3.5.1] 树结构不支持 "stripe" eval @ log.js:21 created @ table.js:961 invokeWithErrorHandling @ vue.esm.js:1862 callHook @ vue.esm.js:4216 Vue._init @ vue.esm.js:5001 VueComponent @ vue.esm.js:5147 createComponentInstanceForVnode @ vue.esm.js:3289 init @ vue.esm.js:3120 createComponent @ vue.esm.js:5973 createElm @ vue.esm.js:5920 createChildren @ vue.esm.js:6048 createElm @ vue.esm.js:5949 patch @ vue.esm.js:6472 Vue._update @ vue.esm.js:3942 updateComponent @ vue.esm.js:4063 get @ vue.esm.js:4476 Watcher @ vue.esm.js:4465 mountComponent @ vue.esm.js:4070 Vue.$mount @ vue.esm.js:9047 Vue.$mount @ vue.esm.js:11941 init @ vue.esm.js:3124 createComponent @ vue.esm.js:5973 createElm @ vue.esm.js:5920 createChildren @ vue.esm.js:6048 createElm @ vue.esm.js:5949 createChildren @ vue.esm.js:6048 createElm @ vue.esm.js:5949 patch @ vue.esm.js:6472 Vue._update @ vue.esm.js:3942 updateComponent @ vue.esm.js:4063 get @ vue.esm.js:4476 Watcher @ vue.esm.js:4465 mountComponent @ vue.esm.js:4070 Vue.$mount @ vue.esm.js:9047 Vue.$mount @ vue.esm.js:11941 init @ vue.esm.js:3124 merged @ vue.esm.js:3307 createComponent @ vue.esm.js:5973 createElm @ vue.esm.js:5920 patch @ vue.esm.js:6511 Vue._update @ vue.esm.js:3945 updateComponent @ vue.esm.js:4063 get @ vue.esm.js:4476 run @ vue.esm.js:4551 flushSchedulerQueue @ vue.esm.js:4307 eval @ vue.esm.js:1988 flushCallbacks @ vue.esm.js:1914 Promise.then timerFunc @ vue.esm.js:1941 nextTick @ vue.esm.js:1998 queueWatcher @ vue.esm.js:4399 update @ vue.esm.js:4541 Vue.$forceUpdate @ vue.esm.js:3966 eval @ vue.esm.js:8832 wrappedHook @ vue.esm.js:2243 invokeWithErrorHandling @ vue.esm.js:1862 invoker @ vue.esm.js:2183 eval @ vue.esm.js:8328 eval @ vue.esm.js:346 end @ vue.esm.js:8028 eval @ vue.esm.js:8039 setTimeout whenTransitionEnds @ vue.esm.js:8037 eval @ vue.esm.js:8360 requestAnimationFrame eval @ vue.esm.js:7995 requestAnimationFrame nextFrame @ vue.esm.js:7994 performLeave @ vue.esm.js:8352 leave @ vue.esm.js
最新发布
10-29
:8081/#/stu:1 Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.Understand this errorAI :8081/#/stu:1 Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.Understand this errorAI :8081/#/stu:1 Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.Understand this errorAI content.js-c1c147bd.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading &#39;exception&#39;) at content.js-c1c147bd.js:1:42224 (anonymous) @ content.js-c1c147bd.js:1Understand this errorAI main.js:26 [Vue warn]: Property or method "handleOpen" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties. found in ---> <IndexCom> at src/components/index.vue <App> at src/App.vue <Root> warn @ vue.runtime.esm.js:4482 warnNonPresent_1 @ vue.runtime.esm.js:5082 get @ vue.runtime.esm.js:5115 render @ index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/index.vue?vue&type=template&id=47323bf2&scoped=true:44 Vue._render @ vue.runtime.esm.js:2649 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6737 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 eval @ main.js:26 ./src/main.js @ app.js:597 __webpack_require__ @ app.js:646 (anonymous) @ app.js:1797 __webpack_require__.O @ app.js:696 (anonymous) @ app.js:1798 (anonymous) @ app.js:1800Understand this errorAI main.js:26 [Vue warn]: Property or method "handleClose" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties. found in ---> <IndexCom> at src/components/index.vue <App> at src/App.vue <Root> warn @ vue.runtime.esm.js:4482 warnNonPresent_1 @ vue.runtime.esm.js:5082 get @ vue.runtime.esm.js:5115 render @ index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/index.vue?vue&type=template&id=47323bf2&scoped=true:45 Vue._render @ vue.runtime.esm.js:2649 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6737 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 eval @ main.js:26 ./src/main.js @ app.js:597 __webpack_require__ @ app.js:646 (anonymous) @ app.js:1797 __webpack_require__.O @ app.js:696 (anonymous) @ app.js:1798 (anonymous) @ app.js:1800Understand this errorAI main.js:26 [Vue warn]: Invalid handler for event "open": got undefined found in ---> <ElMenu> at packages/menu/src/menu.vue <ElAside> at packages/aside/src/main.vue <ElContainer> at packages/container/src/main.vue... (1 recursive calls) <IndexCom> at src/components/index.vue <App> at src/App.vue <Root> warn @ vue.runtime.esm.js:4482 updateListeners @ vue.runtime.esm.js:1859 updateComponentListeners @ vue.runtime.esm.js:3541 initEvents @ vue.runtime.esm.js:3520 Vue._init @ vue.runtime.esm.js:5443 VueComponent @ vue.runtime.esm.js:5576 createComponentInstanceForVnode @ vue.runtime.esm.js:4422 init @ vue.runtime.esm.js:4276 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6737 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 eval @ main.js:26 ./src/main.js @ app.js:597 __webpack_require__ @ app.js:646 (anonymous) @ app.js:1797 __webpack_require__.O @ app.js:696 (anonymous) @ app.js:1798 (anonymous) @ app.js:1800Understand this errorAI main.js:26 [Vue warn]: Invalid handler for event "close": got undefined found in ---> <ElMenu> at packages/menu/src/menu.vue <ElAside> at packages/aside/src/main.vue <ElContainer> at packages/container/src/main.vue... (1 recursive calls) <IndexCom> at src/components/index.vue <App> at src/App.vue <Root> warn @ vue.runtime.esm.js:4482 updateListeners @ vue.runtime.esm.js:1859 updateComponentListeners @ vue.runtime.esm.js:3541 initEvents @ vue.runtime.esm.js:3520 Vue._init @ vue.runtime.esm.js:5443 VueComponent @ vue.runtime.esm.js:5576 createComponentInstanceForVnode @ vue.runtime.esm.js:4422 init @ vue.runtime.esm.js:4276 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6737 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 eval @ main.js:26 ./src/main.js @ app.js:597 __webpack_require__ @ app.js:646 (anonymous) @ app.js:1797 __webpack_require__.O @ app.js:696 (anonymous) @ app.js:1798 (anonymous) @ app.js:1800Understand this errorAI main.js:26 [Vue warn]: Error in created hook: "TypeError: this.stuList is not a function" found in ---> <StudentList> at src/components/studentList.vue <ElMain> at packages/main/src/main.vue <ElContainer> at packages/container/src/main.vue... (1 recursive calls) <IndexCom> at src/components/index.vue <App> at src/App.vue <Root> warn @ vue.runtime.esm.js:4482 logError @ vue.runtime.esm.js:2985 globalHandleError @ vue.runtime.esm.js:2981 handleError @ vue.runtime.esm.js:2949 invokeWithErrorHandling @ vue.runtime.esm.js:2965 callHook$1 @ vue.runtime.esm.js:3929 Vue._init @ vue.runtime.esm.js:5449 VueComponent @ vue.runtime.esm.js:5576 createComponentInstanceForVnode @ vue.runtime.esm.js:4422 init @ vue.runtime.esm.js:4276 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6737 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 eval @ main.js:26 ./src/main.js @ app.js:597 __webpack_require__ @ app.js:646 (anonymous) @ app.js:1797 __webpack_require__.O @ app.js:696 (anonymous) @ app.js:1798 (anonymous) @ app.js:1800Understand this errorAI main.js:26 TypeError: this.stuList is not a function at VueComponent.created (index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/studentList.vue?vue&type=script&lang=js:6:10) at invokeWithErrorHandling (vue.runtime.esm.js:2957:57) at callHook$1 (vue.runtime.esm.js:3929:7) at Vue._init (vue.runtime.esm.js:5449:5) at new VueComponent (vue.runtime.esm.js:5576:12) at createComponentInstanceForVnode (vue.runtime.esm.js:4422:10) at init (vue.runtime.esm.js:4276:45) at merged (vue.runtime.esm.js:4439:5) at createComponent (vue.runtime.esm.js:6264:9) at createElm (vue.runtime.esm.js:6226:9) logError @ vue.runtime.esm.js:2989 globalHandleError @ vue.runtime.esm.js:2981 handleError @ vue.runtime.esm.js:2949 invokeWithErrorHandling @ vue.runtime.esm.js:2965 callHook$1 @ vue.runtime.esm.js:3929 Vue._init @ vue.runtime.esm.js:5449 VueComponent @ vue.runtime.esm.js:5576 createComponentInstanceForVnode @ vue.runtime.esm.js:4422 init @ vue.runtime.esm.js:4276 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6737 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 eval @ main.js:26 ./src/main.js @ app.js:597 __webpack_require__ @ app.js:646 (anonymous) @ app.js:1797 __webpack_require__.O @ app.js:696 (anonymous) @ app.js:1798 (anonymous) @ app.js:1800Understand this errorAI main.js:26 [Violation] Added non-passive event listener to a scroll-blocking &#39;mousewheel&#39; event. Consider marking event handler as &#39;passive&#39; to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 mousewheel @ element-ui.common.js:1140 bind @ element-ui.common.js:1140 callHook @ vue.runtime.esm.js:6892 _update @ vue.runtime.esm.js:6812 updateDirectives @ vue.runtime.esm.js:6796 invokeCreateHooks @ vue.runtime.esm.js:6349 createElm @ vue.runtime.esm.js:6245 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 merged @ vue.runtime.esm.js:4439 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 createChildren @ vue.runtime.esm.js:6335 createElm @ vue.runtime.esm.js:6243 patch @ vue.runtime.esm.js:6706 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 init @ vue.runtime.esm.js:4277 createComponent @ vue.runtime.esm.js:6264 createElm @ vue.runtime.esm.js:6226 patch @ vue.runtime.esm.js:6737 Vue._update @ vue.runtime.esm.js:3669 updateComponent @ vue.runtime.esm.js:3769 Watcher.get @ vue.runtime.esm.js:3363 Watcher @ vue.runtime.esm.js:3353 mountComponent @ vue.runtime.esm.js:3790 Vue.$mount @ vue.runtime.esm.js:8323 eval @ main.js:26 ./src/main.js @ app.js:597 __webpack_require__ @ app.js:646 (anonymous) @ app.js:1797 __webpack_require__.O @ app.js:696 (anonymous) @ app.js:1798 (anonymous) @ app.js:1800 main.js:26 [Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: http://localhost:8081/fonts/element-icons.ff18efd1.woff vue.runtime.esm.js:8334 Download the Vue Devtools extension for a better development experience: https://github.com/vuejs/vue-devtools
10-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Clarence Liu

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值