JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

Vue computed出现Error in render: "TypeError: XXX is not a function"问题

发布时间 2023-05-26 21:12:21作者: XLouis
原来:
    computed:{
      currentTimeA: function() {
        return Date.now();
      }
    }
<div>{{currentTimeA()}}</div>

在运行的时候出现vue.js:634 [Vue warn]: Error in render: "TypeError: currentTimeA is not a function"

在查看网上的解决办法时了解到computed(计算属性)中的内容会被看作是一个属性,正确的书写方法为。

    computed:{
      currentTimeA: function() {
        return function (){Date.now();}
      }
    }

 

    本栏目推荐文章
  • 【Leetcode1949. 坚定的友谊】使用MySQL在无向图中寻找{"CompleteTripartite", {1, 1, 3}}这个pattern
  • Python中出现"No module named 'requests'"的图文解决办法
  • 在Windows上出现"localhost拒绝连接”的问题
  • "nginx.conf" E514 : write error (file system full?)
  • 加了@SessionAttributes("uid")退出登陆后如何清除session
  • 解决TypeError: string indices must be integers, not str
  • cdn引入vue后报错无法识路径 Uncaught TypeError: Failed to resolve module specifier "vue". Relative references must start with either "/", "./", or "../".
  • jni Exception in thread "main" java.lang.UnsatisfiedLinkError:
  • [Vue warn]: Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".
  • 《大学计算机》课程简介 School of Computer Science and Engineering
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们